commit a28cb7d9705ce3c26942fb60948bc8dcfc2556fd
parent 1cd9cb5d2b9e74f0de6f443ec29906dafcf9fcf3
Author: ThomasV <thomasv@gitorious>
Date: Mon, 24 Aug 2015 14:41:40 +0200
Merge branch 'master' of git://github.com/spesmilo/electrum
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git 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'))