From c2749227334af92c2c4866c762547cb8f9e12795 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 29 May 2014 15:07:09 -0400 Subject: [PATCH] tests for the new helper Signed-off-by: Alfredo Deza --- ceph_deploy/tests/unit/hosts/test_centos.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ceph_deploy/tests/unit/hosts/test_centos.py diff --git a/ceph_deploy/tests/unit/hosts/test_centos.py b/ceph_deploy/tests/unit/hosts/test_centos.py new file mode 100644 index 0000000..d2896ef --- /dev/null +++ b/ceph_deploy/tests/unit/hosts/test_centos.py @@ -0,0 +1,21 @@ +from ceph_deploy.hosts import centos +from mock import Mock + + +class TestCentosUrlPart(object): + + def setup(self): + self.distro = Mock() + + def test_url_fallsback_to_el6(self): + assert centos.repository_url_part(self.distro) == 'el6' + + def test_url_detects_rhel6(self): + self.distro.normalized_name = 'redhat' + assert centos.repository_url_part(self.distro) == 'rhel6' + + def test_url_detects_rhel5(self): + self.distro.normalized_name = 'redhat' + self.distro.release = '5.0' + assert centos.repository_url_part(self.distro) == 'el6' + -- 2.47.3