From 8e28dd17953ee6fafef4f1e7882b51205f9e33ce Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 20 Feb 2015 13:58:16 -0500 Subject: [PATCH] more tests cases for the sanitizer args function Signed-off-by: Alfredo Deza --- ceph_deploy/tests/test_install.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- 2.47.3