From a92ca583bdbffbde91065a8438e18add41973f62 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Mon, 24 Aug 2015 10:01:29 +0300 Subject: [PATCH] test_interface: fix check_host_name test --- lib/tests/test_interface.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/tests/test_interface.py b/lib/tests/test_interface.py index b246e3183..9b663e6b8 100644 --- a/lib/tests/test_interface.py +++ b/lib/tests/test_interface.py @@ -13,12 +13,14 @@ class TestInterface(unittest.TestCase): self.assertFalse(interface._match_hostname('asd.fgh.com', '*.zxc.com')) def test_check_host_name(self): - self.assertFalse(interface.check_host_name(None, None)) - self.assertFalse(interface.check_host_name( + i = interface.TcpConnection(server=':1:', queue=None, config_path=None) + + self.assertFalse(i.check_host_name(None, None)) + self.assertFalse(i.check_host_name( peercert={'subjectAltName': []}, name='')) - self.assertTrue(interface.check_host_name( - peercert={'subjectAltName': [('DNS', '*.bar.com')]}, + self.assertTrue(i.check_host_name( + peercert={'subjectAltName': [('DNS', 'foo.bar.com')]}, name='foo.bar.com')) - self.assertTrue(interface.check_host_name( - peercert={'subject': [('commonName', '*.bar.com')]}, + self.assertTrue(i.check_host_name( + peercert={'subject': [('commonName', 'foo.bar.com')]}, name='foo.bar.com'))