]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
tests for the new helper 194/head
authorAlfredo Deza <alfredo.deza@inktank.com>
Thu, 29 May 2014 19:07:09 +0000 (15:07 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Thu, 29 May 2014 19:07:09 +0000 (15:07 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/tests/unit/hosts/test_centos.py [new file with mode: 0644]

diff --git a/ceph_deploy/tests/unit/hosts/test_centos.py b/ceph_deploy/tests/unit/hosts/test_centos.py
new file mode 100644 (file)
index 0000000..d2896ef
--- /dev/null
@@ -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'
+