def test_scanning2(self, exit, _info, _error): self.core.scan.side_effect = ToolError('abc') CLI(self.core).run() self.core.scan.assert_called_once() _info.assert_called() _error.assert_called() exit.assert_called_once_with(1)
def test_importing2(self, exit, _info, _error): def check_inside_context(oc): inside_test_console_operation_control(oc) self.assertEqual(config.data_file, 'abc.txt') oc.interrupt() self.core.import_.side_effect = check_inside_context CLI(self.core).run() self.core.import_.assert_called_once() _info.assert_called() _error.assert_not_called() exit.assert_not_called()
def test_scanning(self, exit, _info, _error): def check_inside_context(oc): inside_test_console_operation_control(oc) self.assertEqual(config.port_scan_interval, 15) self.core.scan.side_effect = check_inside_context CLI(self.core).run() self.core.scan.assert_called_once() _info.assert_called() _error.assert_not_called() exit.assert_not_called()
def test_reporting_app_details3(self, _info): self.f.report_details() _info.assert_called()
def test_reporting_app_details(self, _info): self.f.app_entry('app1') self.f.port_entry(NetworkProtocol.IPv4, TransportProtocol.TCP, 1) self.f.executable_entry('app1.exe') self.f.report_details() _info.assert_called()
def test_reporting_app_list(self, _info): self.f.app_entry('app1') self.f.app_entry('app2') self.f.report_list() _info.assert_called()