def test_snmp_variable_repr_binary():
    var = SNMPVariable(
        "sysDescr", "0", ub(chr(20)) + "my thingo" + ub(chr(155)), "OCTETSTR"
    )
    assert var.__repr__() == (
        "<SNMPVariable value='my thingo (contains binary)' "
        "(oid='sysDescr', oid_index='0', snmp_type='OCTETSTR')>"
    )
Exemple #2
0
def test_snmp_variable_repr_binary_only():
    var = SNMPVariable(
        'sysDescr', '0',
        ub(chr(20)) + ub(chr(155)),
        'OCTETSTR'
    )
    assert var.__repr__() == (
        "<SNMPVariable value='(contains binary)' "
        "(oid='sysDescr', oid_index='0', snmp_type='OCTETSTR')>"
    )
Exemple #3
0
def test_snmp_variable_repr_none():
    var = SNMPVariable()
    assert var.__repr__() == (
        "<SNMPVariable value=None (oid=None, oid_index=None, snmp_type=None)>")
Exemple #4
0
def test_snmp_variable_repr_binary_only():
    var = SNMPVariable('sysDescr', '0', ub(chr(20)) + ub(chr(155)), 'OCTETSTR')
    assert var.__repr__() == (
        "<SNMPVariable value='(contains binary)' "
        "(oid='sysDescr', oid_index='0', snmp_type='OCTETSTR')>")
Exemple #5
0
def test_snmp_variable_repr():
    var = SNMPVariable('sysDescr', '0', 'my thingo', 'OCTETSTR')
    assert var.__repr__() == (
        "<SNMPVariable value='my thingo' "
        "(oid='sysDescr', oid_index='0', snmp_type='OCTETSTR')>")
Exemple #6
0
def test_snmp_variable_repr_none():
    var = SNMPVariable()
    assert var.__repr__() == (
        "<SNMPVariable value=None (oid=None, oid_index=None, snmp_type=None)>"
    )
Exemple #7
0
def test_snmp_variable_repr():
    var = SNMPVariable('sysDescr', '0', 'my thingo', 'OCTETSTR')
    assert var.__repr__() == (
        "<SNMPVariable value='my thingo' "
        "(oid='sysDescr', oid_index='0', snmp_type='OCTETSTR')>"
    )