From: Alfredo Deza Date: Fri, 5 Sep 2014 15:47:50 +0000 (-0400) Subject: add tests for the needs_ssh fix X-Git-Tag: 0.0.20~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2d5941e20d39dfd5c0cfa7cd48c2cd92d2ad86b;p=remoto.git add tests for the needs_ssh fix --- diff --git a/remoto/tests/test_connection.py b/remoto/tests/test_connection.py index dc5aeeb..324da7c 100644 --- a/remoto/tests/test_connection.py +++ b/remoto/tests/test_connection.py @@ -4,8 +4,9 @@ from remoto import connection class FakeSocket(object): - def __init__(self, gethostname): + def __init__(self, gethostname, getfqdn=None): self.gethostname = lambda: gethostname + self.getfqdn = lambda: getfqdn or gethostname class TestNeedsSsh(object): @@ -22,6 +23,11 @@ class TestNeedsSsh(object): socket = FakeSocket('foo') assert connection.needs_ssh('meh', socket) is True + def test_fqdn_hostname_matches_short_hostname(self): + socket = FakeSocket('foo', getfqdn='foo.example.org') + assert connection.needs_ssh('foo.example.org', socket) is False + + class FakeGateway(object):