def test_factory_snmp_backend_unknown_backend(snmp_config): with pytest.raises(NotImplementedError, match="Unknown SNMP backend"): snmp_config = snmp_config._replace(snmp_backend="bla") if inline: assert isinstance( factory.backend(snmp_config, logging.getLogger()), inline.InlineSNMPBackend) else: assert isinstance( factory.backend(snmp_config, logging.getLogger()), ClassicSNMPBackend, )
def test_factory_snmp_backend_inline(snmp_config): snmp_config = snmp_config._replace(snmp_backend=SNMPBackendEnum.INLINE) if inline: assert isinstance(factory.backend(snmp_config, logging.getLogger()), inline.InlineSNMPBackend)
def test_factory_snmp_backend_pysnmp(snmp_config): snmp_config = snmp_config._replace(snmp_backend=SNMPBackendEnum.PYSNMP) if pysnmp_backend: assert isinstance(factory.backend(snmp_config, logging.getLogger()), pysnmp_backend.PySNMPBackend)
def test_factory_snmp_backend_classic(snmp_config): assert isinstance(factory.backend(snmp_config, logging.getLogger()), ClassicSNMPBackend)