MCPcopy
hub / github.com/jtesta/ssh-audit / test_resolve_error

Method test_resolve_error

test/test_resolve.py:20–30  ·  view source on GitHub ↗
(self, output_spy, virtual_socket)

Source from the content-addressed store, hash-verified

18 return conf
19
20 def test_resolve_error(self, output_spy, virtual_socket):
21 vsocket = virtual_socket
22 vsocket.gsock.addrinfodata['localhost#22'] = socket.gaierror(8, 'hostname nor servname provided, or not known')
23 conf = self._conf()
24 s = self.ssh_socket(self.OutputBuffer(), 'localhost', 22, conf.ip_version_preference)
25 # output_spy.begin()
26 with pytest.raises(socket.gaierror):
27 list(s._resolve())
28 # lines = output_spy.flush()
29 # assert len(lines) == 1
30 # assert 'hostname nor servname provided' in lines[-1]
31
32 def test_resolve_hostname_without_records(self, output_spy, virtual_socket):
33 vsocket = virtual_socket

Callers

nothing calls this directly

Calls 2

_confMethod · 0.95
_resolveMethod · 0.80

Tested by

no test coverage detected