Skip to content

Commit

Permalink
Add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yejianquan committed Dec 17, 2024
1 parent a8c0cfb commit d9f00e8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/test_rfc2737.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_PhysicalTableMIBUpdater_runtime_exc_in_reinit_data_wont_block_reinit_it
def test_PhysicalTableMIBUpdater_runtime_exc_in_reinit_data_wont_block_reinit_iteration_last(self, mock_xcvr_reinit_data):
updater = PhysicalTableMIBUpdater()

with (pytest.raises(RuntimeError) as excinfo,
with (pytest.raises(RuntimeError, match='mocked runtime error1'),
mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.XcvrCacheUpdater.reinit_data') as mocked_xcvr_reinit_data,
mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.PsuCacheUpdater.reinit_data') as mocked_psu_reinit_data,
mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.FanDrawerCacheUpdater.reinit_data') as mocked_fan_drawer_reinit_data,
Expand All @@ -112,7 +112,6 @@ def test_PhysicalTableMIBUpdater_runtime_exc_in_reinit_data_wont_block_reinit_it
mocked_fan_cache_reinit_data.assert_called()
mocked_thermal_reinit_data.assert_called()
mocked_cancel_redis_pubsub.assert_called()
assert str(excinfo.value) == "mocked runtime error"

# Given: 5 physical updaters are register into reinit of PhysicalTableMIBUpdater
# When: The first(XcvrCacheUpdater) and last updater(ThermalCacheUpdater)
Expand Down

0 comments on commit d9f00e8

Please sign in to comment.