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

Method _audit

test/test_errors.py:23–43  ·  view source on GitHub ↗
(self, spy, conf=None, exit_expected=False)

Source from the content-addressed store, hash-verified

21 return conf
22
23 def _audit(self, spy, conf=None, exit_expected=False):
24 if conf is None:
25 conf = self._conf()
26 spy.begin()
27
28 out = OutputBuffer()
29 if exit_expected:
30 with pytest.raises(SystemExit):
31 self.audit(out, conf)
32 else:
33 ret = self.audit(out, conf)
34 assert ret != 0
35
36 out.write()
37 lines = spy.flush()
38
39 # If the last line is empty, delete it.
40 if len(lines) > 1 and lines[-1] == '':
41 del lines[-1]
42
43 return lines
44
45 def test_connection_unresolved(self, output_spy, virtual_socket):
46 vsocket = virtual_socket

Calls 5

_confMethod · 0.95
writeMethod · 0.95
OutputBufferClass · 0.90
beginMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected