From 8aec47a00a67f01a6092bdd058263bc94a14246e Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Thu, 31 Dec 2015 11:23:54 -0500 Subject: Add new click-based CLI --- tests/test_cli.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3