Skip to content

Commit

Permalink
Added error status value/name translation example.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Aug 25, 2024
1 parent f82312b commit c6a4d5b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/hlapi/asyncio/manager/cmdgen/test_v1_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from pysnmp import debug
from pysnmp.hlapi.asyncio import *
from pysnmp.proto.rfc1905 import errorStatus as pysnmp_errorStatus

from tests.agent_context import AGENT_PORT, AgentContextManager

Expand All @@ -27,6 +28,9 @@ async def test_v1_get():
assert varBinds[0][1].prettyPrint().startswith("PySNMP engine version")
assert isinstance(varBinds[0][1], OctetString)

name = pysnmp_errorStatus.namedValues.getName(errorStatus)
assert name == "noError"


@pytest.mark.asyncio
async def test_v1_get_old():
Expand Down

0 comments on commit c6a4d5b

Please sign in to comment.