diff options
Diffstat (limited to 'tests/test_cli.py')
-rw-r--r-- | tests/test_cli.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/tests/test_cli.py b/tests/test_cli.py index f2cd979..7f08010 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,16 +1,10 @@ -from dotfiles.cli import dispatch +from click.testing import CliRunner +from dotfiles import __version__ +from dotfiles.cli import version -def test_dispatch(): - """Test that the force option is handed on to the sync method.""" - class MockDotfiles: - def sync(self, files=None, force=False): - assert force - - class MockNamespace: - def __init__(self): - self.action = 'sync' - self.force = True - - dispatch(MockDotfiles(), MockNamespace(), []) +def test_version(): + runner = CliRunner() + result = runner.invoke(version) + assert ('dotfiles v%s\n' % __version__) == result.output |