mirror of
https://github.com/lopes/netbox-scanner.git
synced 2025-07-22 05:14:39 +02:00
Update unittest for nmap module
This commit is contained in:
parent
5e23996d41
commit
14335e4960
@ -1,16 +1,17 @@
|
||||
import unittest
|
||||
from os import environ
|
||||
|
||||
from nbs.nmap import Nmap
|
||||
|
||||
|
||||
class TestRequest(unittest.TestCase):
|
||||
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)
|
||||
nmap.run()
|
||||
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__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user