From: Alfredo Deza Date: Fri, 20 Feb 2015 18:58:16 +0000 (-0500) Subject: more tests cases for the sanitizer args function X-Git-Tag: v1.5.22-rc1~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F262%2Fhead;p=ceph-deploy.git more tests cases for the sanitizer args function Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/tests/test_install.py b/ceph_deploy/tests/test_install.py index a18f94c..1a76d40 100644 --- a/ceph_deploy/tests/test_install.py +++ b/ceph_deploy/tests/test_install.py @@ -9,6 +9,7 @@ class TestSanitizeArgs(object): self.args = Mock() # set the default behavior we set in cli.py self.args.default_release = False + self.args.stable = None def test_args_release_not_specified(self): self.args.release = None @@ -20,3 +21,18 @@ class TestSanitizeArgs(object): # change that. Future improvement: make the default release a # variable in `ceph_deploy/__init__.py` assert result.default_release is True + + def test_args_release_is_specified(self): + self.args.release = 'dumpling' + result = install.sanitize_args(self.args) + assert result.default_release is False + + def test_args_release_stable_is_used(self): + self.args.stable = 'dumpling' + result = install.sanitize_args(self.args) + assert result.release == 'dumpling' + + def test_args_stable_is_not_used(self): + self.args.release = 'dumpling' + result = install.sanitize_args(self.args) + assert result.stable is None