diff --git a/tests/hlapi/asyncio/agent/ntforg/test_v3-inform.py b/tests/hlapi/asyncio/agent/ntforg/test_v3-inform.py index 1c720415..5f91ed99 100644 --- a/tests/hlapi/asyncio/agent/ntforg/test_v3-inform.py +++ b/tests/hlapi/asyncio/agent/ntforg/test_v3-inform.py @@ -7,31 +7,16 @@ @pytest.mark.asyncio async def test_send_v3_inform(): async with ManagerContextManager(): - # Assemble MIB browser - mibBuilder = builder.MibBuilder() - mibViewController = view.MibViewController(mibBuilder) - compiler.addMibCompiler( - mibBuilder, - sources=[ - "file:///usr/share/snmp/mibs", - "https://mibs.pysnmp.com/asn1/@mib@", - ], - ) - - # Pre-load MIB modules we expect to work with - mibBuilder.loadModules("SNMPv2-MIB") - snmpEngine = SnmpEngine() - snmpEngine.cache["mibViewController"] = mibViewController errorIndication, errorStatus, errorIndex, varBinds = await sendNotification( snmpEngine, UsmUserData("usr-md5-des", "authkey1", "privkey1"), UdpTransportTarget(("localhost", MANAGER_PORT)), ContextData(), "inform", - NotificationType(ObjectIdentity("1.3.6.1.6.3.1.1.5.2")).addVarBinds( - ("1.3.6.1.2.1.1.1.0", OctetString("my system")) - ), + NotificationType(ObjectIdentity("1.3.6.1.6.3.1.1.5.2")) + .loadMibs("SNMPv2-MIB") + .addVarBinds(("1.3.6.1.2.1.1.1.0", OctetString("my system"))), ) assert errorIndication is None diff --git a/tests/hlapi/asyncio/manager/cmdgen/test_v1_next.py b/tests/hlapi/asyncio/manager/cmdgen/test_v1_next.py index 38bcf7d7..827f9c00 100644 --- a/tests/hlapi/asyncio/manager/cmdgen/test_v1_next.py +++ b/tests/hlapi/asyncio/manager/cmdgen/test_v1_next.py @@ -23,25 +23,15 @@ @pytest.mark.asyncio async def test_v1_next(): - # Assemble MIB browser - mibBuilder = builder.MibBuilder() - mibViewController = view.MibViewController(mibBuilder) - compiler.addMibCompiler( - mibBuilder, - sources=["file:///usr/share/snmp/mibs", "https://mibs.pysnmp.com/asn1/@mib@"], - ) - - # Pre-load MIB modules we expect to work with - mibBuilder.loadModules("PYSNMP-MIB") - async with AgentContextManager(): with Slim(1) as slim: - slim.snmpEngine.cache["mibViewController"] = mibViewController errorIndication, errorStatus, errorIndex, varBinds = await slim.next( "public", "localhost", AGENT_PORT, - ObjectType(ObjectIdentity("SNMPv2-MIB", "sysDescr", 0)), + ObjectType( + ObjectIdentity("SNMPv2-MIB", "sysDescr", 0).loadMibs("PYSNMP-MIB") + ), ) assert errorIndication is None