Add errors that were added with pysnmp 4.3.6
We recreate pysnmp errors within virtualpdu and errors has changed with pysnmp 4.3.6 By adding the test name, the exceptions are now in sync. Change-Id: I2d4dccde08bd85a166e8dd3e0f1d0708ea0f0c69
This commit is contained in:
parent
a86e32c8f3
commit
32bfd146b9
@ -175,3 +175,15 @@ class SNMPApplicationError(SNMPErrorIndication):
|
||||
|
||||
class OidNotIncreasing(SNMPApplicationError):
|
||||
pass
|
||||
|
||||
|
||||
class ReportPduReceived(SNMPErrorIndication):
|
||||
pass
|
||||
|
||||
|
||||
class UnknownUserName(SNMPErrorIndication):
|
||||
pass
|
||||
|
||||
|
||||
class WrongDigest(SNMPErrorIndication):
|
||||
pass
|
||||
|
@ -17,6 +17,9 @@ from mock import sentinel
|
||||
from pysnmp.proto import errind
|
||||
from pysnmp.proto.errind import ErrorIndication
|
||||
from pysnmp.proto.rfc1905 import NoSuchInstance
|
||||
|
||||
import testtools
|
||||
|
||||
from virtualpdu.tests import base
|
||||
from virtualpdu.tests import snmp_client
|
||||
from virtualpdu.tests import snmp_error_indications
|
||||
@ -92,8 +95,8 @@ class TestSnmpClient(base.TestCase):
|
||||
|
||||
exception_class = snmp_error_indications.__dict__.get(class_name)
|
||||
|
||||
self.assertRaises(exception_class,
|
||||
self.snmp_client.get_one, oid)
|
||||
with testtools.ExpectedException(exception_class):
|
||||
self.snmp_client.get_one(oid)
|
||||
|
||||
def test_set(self):
|
||||
oid = (1, 3, 6)
|
||||
|
Loading…
Reference in New Issue
Block a user