diff options
author | Jon Bernard <jbernard@tuxion.com> | 2015-12-31 11:23:54 -0500 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2015-12-31 11:25:04 -0500 |
commit | 8aec47a00a67f01a6092bdd058263bc94a14246e (patch) | |
tree | cf6aff7e3917bbe52bfdbc2b3c333b8f8e4327c5 /tests | |
parent | c91c4c58ea7a85986feaae2528f84ea53995c45d (diff) | |
download | dotfiles-8aec47a00a67f01a6092bdd058263bc94a14246e.tar.gz dotfiles-8aec47a00a67f01a6092bdd058263bc94a14246e.tar.bz2 dotfiles-8aec47a00a67f01a6092bdd058263bc94a14246e.zip |
Add new click-based CLI
Diffstat (limited to 'tests')
-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 |