-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c68978c
commit 95e1901
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import sys | ||
from unittest import TestCase | ||
from sonic_ax_impl.mibs.ietf.rfc2737 import PhysicalTableMIBUpdater | ||
|
||
|
||
if sys.version_info.major == 3: | ||
from unittest import mock | ||
else: | ||
import mock | ||
|
||
modules_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
sys.path.insert(0, os.path.join(modules_path, 'src')) | ||
|
||
|
||
class TestPhysicalSensorTableMIBUpdater(TestCase): | ||
|
||
@mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.PsuCacheUpdater.reinit_data', side_effect=Exception('mocked error')) | ||
def test_PhysicalSensorTableMIBUpdater_transceiver_info_key_missing(self): | ||
updater = PhysicalTableMIBUpdater() | ||
|
||
with mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.ThermalCacheUpdater.reinit_data') as mocked_reinit_data: | ||
updater.reinit_data() | ||
|
||
# check warning | ||
mocked_reinit_data.assert_called() |