mirror of
https://github.com/lopes/netbox-scanner.git
synced 2025-07-22 21:34:56 +02:00
Update unittest for nmap module
This commit is contained in:
parent
5e23996d41
commit
14335e4960
@ -1,16 +1,17 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from os import environ
|
|
||||||
from nbs.nmap import Nmap
|
from nbs.nmap import Nmap
|
||||||
|
|
||||||
|
|
||||||
class TestRequest(unittest.TestCase):
|
class TestRequest(unittest.TestCase):
|
||||||
def test_api(self):
|
def test_api(self):
|
||||||
path = environ.get('NMAP_PATH')
|
|
||||||
|
|
||||||
nmap = Nmap(path, 'test')
|
nmap = Nmap("test", ["127.0.0.1/32"])
|
||||||
self.assertIsInstance(nmap, Nmap)
|
self.assertIsInstance(nmap, Nmap)
|
||||||
nmap.run()
|
nmap.run()
|
||||||
self.assertIsInstance(nmap.hosts, list)
|
self.assertIsInstance(nmap.hosts, list)
|
||||||
|
self.assertEqual(nmap.hosts[0][0], "127.0.0.1")
|
||||||
|
self.assertEqual(nmap.hosts[0][1], "localhost")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user