Skip to content

Commit

Permalink
Adding translate test
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed May 15, 2019
1 parent 67bcf0f commit 0a1b114
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_translate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Setting French as system language
import os
os.environ['LC_ALL'] = 'fr_FR.utf-8'

import pytest
import sys

from plumbum import cli

class Simple(cli.Application):
foo = cli.SwitchAttr("--foo")

def main(self):
pass

class TestFRCLI:
def test_nolang_switches(self):
_, rc = Simple.run(["foo", "-h"], exit = False)
assert rc == 0
_, rc = Simple.run(["foo", "--version"], exit = False)
assert rc == 0

def test_help_lang(self, capsys):
_, rc = Simple.run(["foo", "-h"], exit = False)
assert rc == 0
stdout, stderr = capsys.readouterr()
assert "Utilisation" in stdout
assert "Imprime ce message d'aide et sort" in stdout

0 comments on commit 0a1b114

Please sign in to comment.