]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add unit tests for (de)canonicalize_hostname()
authorZack Cerza <zack@cerza.org>
Mon, 19 May 2014 20:22:30 +0000 (15:22 -0500)
committerZack Cerza <zack.cerza@inktank.com>
Mon, 25 Aug 2014 17:14:36 +0000 (11:14 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/test/test_lock.py [new file with mode: 0644]

diff --git a/teuthology/test/test_lock.py b/teuthology/test/test_lock.py
new file mode 100644 (file)
index 0000000..b7ac33a
--- /dev/null
@@ -0,0 +1,14 @@
+from .. import lock
+
+
+class TestLock(object):
+
+    def test_canonicalize_hostname(self):
+        host_base = 'box1'
+        result = lock.canonicalize_hostname(host_base)
+        assert result == 'ubuntu@box1.front.sepia.ceph.com'
+
+    def test_decanonicalize_hostname(self):
+        host = 'ubuntu@box1.front.sepia.ceph.com'
+        result = lock.decanonicalize_hostname(host)
+        assert result == 'box1'