From 942741c10a0f2d1202b03a4ab9ca2c83d1d333fc Mon Sep 17 00:00:00 2001
From: thijs snijder <snijder@astron.nl>
Date: Fri, 23 Sep 2022 12:20:03 +0200
Subject: [PATCH] L2SS-874 added missing MIB test

---
 .../test/clients/test_snmp_client.py                   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tangostationcontrol/tangostationcontrol/test/clients/test_snmp_client.py b/tangostationcontrol/tangostationcontrol/test/clients/test_snmp_client.py
index 90eb14636..e0ec059f4 100644
--- a/tangostationcontrol/tangostationcontrol/test/clients/test_snmp_client.py
+++ b/tangostationcontrol/tangostationcontrol/test/clients/test_snmp_client.py
@@ -1,5 +1,5 @@
 from pysnmp import hlapi
-from pysnmp.smi import view
+from pysnmp.smi import view, error
 from pysnmp.smi.rfc1902 import ObjectIdentity
 from os import path
 import numpy
@@ -260,3 +260,11 @@ class TestMibLoading(base.TestCase):
 
         # get the numerical value
         self.assertEqual(int(obj_T[1]), testNamedValue_value)
+
+    def test_mib_missing(self):
+        abs_dir = path.dirname(__file__) + "/" + self.REL_DIR + "/"
+        loader = mib_loader(abs_dir)
+
+        with self.assertRaises(error.MibNotFoundError):
+            loader.load_pymib("FAKE-MIB")
+
-- 
GitLab