def test_multipe_osmatch():
assert('osmatch' in nm['127.0.0.1'])
assert('portused' in nm['127.0.0.1'])
for osm in nm['127.0.0.1']['osmatch']:
assert('accuracy' in osm)
assert('line' in osm)
assert('name' in osm)
assert('osclass' in osm)
assert('accuracy' in osm['osclass'][0])
assert('cpe' in osm['osclass'][0])
assert('osfamily' in osm['osclass'][0])
assert('osgen' in osm['osclass'][0])
assert('type' in osm['osclass'][0])
assert('vendor' in osm['osclass'][0])
# def test_host_and_port_as_unicode():
# # nosetests -x -s nmap/test_nmap.py:test_port_as_unicode
# # Covers bug : https://bitbucket.org/xael/python-nmap/issues/9/can-not-pass-ports-with-unicode-string-at
# nma = nm.scan(hosts=u'127.0.0.1', ports=u'22')
# assert_equals(nma['nmap']['scaninfo']['error'], '')
评论列表
文章目录