]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
create a test for the args sanitizer function
authorAlfredo Deza <alfredo.deza@inktank.com>
Fri, 20 Feb 2015 18:54:51 +0000 (13:54 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Fri, 20 Feb 2015 18:54:51 +0000 (13:54 -0500)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/tests/test_install.py [new file with mode: 0644]

diff --git a/ceph_deploy/tests/test_install.py b/ceph_deploy/tests/test_install.py
new file mode 100644 (file)
index 0000000..a18f94c
--- /dev/null
@@ -0,0 +1,22 @@
+from mock import Mock
+
+from ceph_deploy import install
+
+
+class TestSanitizeArgs(object):
+
+    def setup(self):
+        self.args = Mock()
+        # set the default behavior we set in cli.py
+        self.args.default_release = False
+
+    def test_args_release_not_specified(self):
+        self.args.release = None
+        result = install.sanitize_args(self.args)
+        # XXX
+        # we should get `args.release` to be the latest release
+        # but we don't want to be updating this test every single
+        # time there is a new default value, and we can't programatically
+        # change that. Future improvement: make the default release a
+        # variable in `ceph_deploy/__init__.py`
+        assert result.default_release is True