Created
July 16, 2013 12:14
-
-
Save norrs/6008167 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self = <unittests.Snmp.Snmp_test.SnmpTests testMethod=test_load_pysnmp_se_if_pynetsnmp_is_not_available> | |
def test_load_pysnmp_se_if_pynetsnmp_is_not_available(self): | |
pysnmp = Mock() | |
modules = { | |
'pynetsnmp.netsnmp': None, | |
'pynetsnmp': None, | |
'pysnmp': pysnmp, | |
'pysnmp.asn1': pysnmp.asn1, | |
'pysnmp.asn1.oid': pysnmp.asn1.oid, | |
'pysnmp.mapping': pysnmp.mapping, | |
'pysnmp.mapping.udp': pysnmp.mapping.udp, | |
'pysnmp.mapping.udp.role': pysnmp.mapping.udp.role, | |
'pysnmp.proto': pysnmp.proto, | |
'pysnmp.proto.api': pysnmp.proto.api | |
} | |
with patch.dict('sys.modules', modules): | |
pytest.raises(ImportError, 'import pynetsnmp') | |
pytest.raises(ImportError, 'from pynetsnmp import netsnmp') | |
> pytest.raises(ImportError, 'from nav.Snmp.pynetsnmp import *') | |
E Failed: DID NOT RAISE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment