mirror of https://github.com/OWASP/Nettacker.git
Merge branch 'master' into dependabot/pip/pyopenssl-23.2.0
This commit is contained in:
commit
77b6a8e9b9
|
|
@ -1,14 +1,14 @@
|
|||
argparse==1.4.0
|
||||
netaddr==0.8.0
|
||||
ipaddr==2.2.0
|
||||
requests==2.28.2
|
||||
requests==2.31.0
|
||||
aiohttp==3.8.4
|
||||
asyncio==3.4.3
|
||||
paramiko==3.1.0
|
||||
paramiko==3.2.0
|
||||
texttable==1.6.7
|
||||
PySocks==1.7.1 # library_name=socks # module name is not equal to socks name; this is required to be checked on startup
|
||||
pyOpenSSL==23.2.0 # library_name=OpenSSL
|
||||
flask==2.2.5
|
||||
flask==2.3.2
|
||||
SQLAlchemy>=1.3.0 # library_name=sqlalchemy
|
||||
py3DNS==3.2.1 # library_name=DNS
|
||||
numpy==1.24.3
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ This is the utility unit testing module
|
|||
"""
|
||||
|
||||
import sys
|
||||
import multiprocessing
|
||||
import unittest
|
||||
from core import utility
|
||||
|
||||
|
|
@ -16,7 +17,6 @@ class UtilityTesting(unittest.TestCase):
|
|||
|
||||
def test_sort_dictonary(self):
|
||||
"""Tests if the function sorts the input dictionary."""
|
||||
|
||||
input_dict = {
|
||||
'a': 1,
|
||||
'c': 3,
|
||||
|
|
@ -31,6 +31,19 @@ class UtilityTesting(unittest.TestCase):
|
|||
}
|
||||
self.assertDictEqual(utility.sort_dictonary(input_dict), sorted_dict)
|
||||
|
||||
def test_select_maximum_cpu_core(self):
|
||||
"""Tests if it selects the proper amount of cpu's"""
|
||||
|
||||
num_cores = int(multiprocessing.cpu_count()) - 1
|
||||
|
||||
self.assertNotEqual(utility.select_maximum_cpu_core('maximum'), 3)
|
||||
self.assertEqual(utility.select_maximum_cpu_core('max'), 1)
|
||||
self.assertEqual(utility.select_maximum_cpu_core('maximum'), num_cores)
|
||||
self.assertGreaterEqual(utility.select_maximum_cpu_core('high'), 1)
|
||||
self.assertGreaterEqual(utility.select_maximum_cpu_core('normal'), 1)
|
||||
self.assertGreaterEqual(utility.select_maximum_cpu_core('low'), 1)
|
||||
self.assertEqual(utility.select_maximum_cpu_core('some rand value'), 1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue