From: Alfredo Deza Date: Thu, 29 May 2014 19:07:09 +0000 (-0400) Subject: tests for the new helper X-Git-Tag: v1.5.3~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c2749227334af92c2c4866c762547cb8f9e12795;p=ceph-deploy.git tests for the new helper Signed-off-by: Alfredo Deza --- 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' +