From: Dmitry Borodaenko Date: Tue, 10 Sep 2013 21:40:09 +0000 (-0700) Subject: split unit test into two, fix typo in comments X-Git-Tag: v1.2.4~11^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a319e4c82d85206851de66d6b661d93a90f924d2;p=ceph-deploy.git split unit test into two, fix typo in comments Signed-off-by: Dmitry Borodaenko --- diff --git a/ceph_deploy/misc.py b/ceph_deploy/misc.py index 08d7ce3..b4b8318 100644 --- a/ceph_deploy/misc.py +++ b/ceph_deploy/misc.py @@ -26,7 +26,7 @@ def mon_hosts(mons): def remote_shortname(socket): """ Obtains remote hostname of the socket and cuts off the domain part - if it's FQDN. + of its FQDN. """ return socket.gethostname().split('.', 1)[0] diff --git a/ceph_deploy/tests/unit/test_mon.py b/ceph_deploy/tests/unit/test_mon.py index 7f0c601..7ffb5ba 100644 --- a/ceph_deploy/tests/unit/test_mon.py +++ b/ceph_deploy/tests/unit/test_mon.py @@ -131,11 +131,12 @@ class TestCreateMon(object): result = hosts.mock_calls assert result == expected - def test_remote_shortname(self): + def test_remote_shortname_fqdn(self): socket = Mock() socket.gethostname.return_value = 'host.f.q.d.n' assert remote_shortname(socket) == 'host' + def test_remote_shortname_host(self): socket = Mock() socket.gethostname.return_value = 'host' assert remote_shortname(socket) == 'host'