Skip to content

Commit

Permalink
Update vendor task
Browse files Browse the repository at this point in the history
Vendortask cant continue if a timeouterror occurs, so it should
just let it go further up the chain
  • Loading branch information
stveit committed Oct 4, 2023
1 parent cd0fdb1 commit 31a45b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/tasks/test_vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 31a45b5

Please sign in to comment.