aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2015-12-29 07:07:28 -0500
committerGravatar Jon Bernard <jbernard@tuxion.com> 2015-12-29 07:15:54 -0500
commitcadfa750ca0c950d61ded1dbad85beea9d152ef8 (patch)
tree1403ab4d7ea86e1432a704efd2954b763a51c322
parentf383fba3c07b573f758dfe1d91e144d547848c1a (diff)
downloaddotfiles-cadfa750ca0c950d61ded1dbad85beea9d152ef8.tar.gz
dotfiles-cadfa750ca0c950d61ded1dbad85beea9d152ef8.tar.bz2
dotfiles-cadfa750ca0c950d61ded1dbad85beea9d152ef8.zip
Move CLI tests into separate file
The intent is for each file in dotfiles/ to have a matching test file in tests/ so there is less confusion about which test files are testing which bits of functionality and where to look.
-rw-r--r--tests/test_basic.py15
-rw-r--r--tests/test_cli.py16
2 files changed, 16 insertions, 15 deletions
diff --git a/tests/test_basic.py b/tests/test_basic.py
index 20019bb..97c643c 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -6,7 +6,6 @@ import shutil
import tempfile
import unittest
-from dotfiles.cli import dispatch
from dotfiles.core import Dotfiles
from dotfiles.utils import is_link_to
@@ -61,20 +60,6 @@ class DotfilesTestCase(unittest.TestCase):
os.path.join(self.homedir, '.lastpass'),
'/tmp')
- def test_dispatch(self):
- """Test that the force option is handed on to the sync method."""
-
- class MockDotfiles(object):
- def sync(self, files=None, force=False):
- assert force
-
- class MockNamespace(object):
- def __init__(self):
- self.action = 'sync'
- self.force = True
-
- dispatch(MockDotfiles(), MockNamespace(), [])
-
def test_move_repository(self):
"""Test the move() method for a Dotfiles repository."""
diff --git a/tests/test_cli.py b/tests/test_cli.py
new file mode 100644
index 0000000..f2cd979
--- /dev/null
+++ b/tests/test_cli.py
@@ -0,0 +1,16 @@
+from dotfiles.cli import dispatch
+
+
+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(), [])