| 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 |