From fe4bf332628b104865ca79a218800c0182c9faaa Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 19 May 2014 15:22:30 -0500 Subject: [PATCH] Add unit tests for (de)canonicalize_hostname() Signed-off-by: Zack Cerza --- teuthology/test/test_lock.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 teuthology/test/test_lock.py diff --git a/teuthology/test/test_lock.py b/teuthology/test/test_lock.py new file mode 100644 index 0000000000..b7ac33ae8a --- /dev/null +++ b/teuthology/test/test_lock.py @@ -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' -- 2.39.5