From a2d5941e20d39dfd5c0cfa7cd48c2cd92d2ad86b Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 5 Sep 2014 11:47:50 -0400 Subject: [PATCH] add tests for the needs_ssh fix --- remoto/tests/test_connection.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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): -- 2.47.3