def test_run_fetcher_with_failure(self): assert run_fetcher( { "fetcher_type": "SNMP", "trash": 1 }, Mode.CHECKING, 13, ) == b"SNMP :50 :26 :KeyError('fetcher_params')"
def test_run_fetcher_with_failure(self): message = run_fetcher( { "fetcher_type": "SNMP", "trash": 1 }, Mode.CHECKING, ) assert message.header.fetcher_type is FetcherType.SNMP assert message.header.status == 50 assert message.header.payload_length == (len(message) - len(message.header) - message.header.stats_length) assert type(message.raw_data.error) is KeyError # pylint: disable=C0123 assert str(message.raw_data.error) == repr("fetcher_params")
def test_run_fetcher_with_exception(self): with pytest.raises(RuntimeError): run_fetcher({"trash": 1}, Mode.CHECKING)