From 8e6c4ff14c32b5fc04a394d65d0e6987139358c1 Mon Sep 17 00:00:00 2001 From: Simon Oliver Tveit Date: Wed, 4 Oct 2023 15:40:32 +0200 Subject: [PATCH] Update vendor task Vendortask cant continue if a timeouterror occurs, so it should just let it go further up the chain --- tests/tasks/test_vendor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/tasks/test_vendor.py b/tests/tasks/test_vendor.py index d66c7e92b..c50352be2 100644 --- a/tests/tasks/test_vendor.py +++ b/tests/tasks/test_vendor.py @@ -19,11 +19,12 @@ async def test_run_should_set_enterprise_id(self, snmpsim, snmp_test_port): assert state.devices[device.name].enterprise_id == 11 @pytest.mark.asyncio - async def test_run_should_do_nothing_when_there_is_no_response(self): + async def test_run_should_raise_exception_when_there_is_no_response(self): device = PollDevice(name="localhost", address="127.0.0.1", community="invalid", port=666) state = ZinoState() task = VendorTask(device, state) with patch("zino.tasks.reachabletask.SNMP.get") as get_mock: get_mock.side_effect = TimeoutError - assert (await task.run()) is None + with pytest.raises(TimeoutError): + await task.run() assert len(state.devices) == 0