Merge branch 'master' into dependabot/pip/pyopenssl-23.2.0

This commit is contained in:
Sam Stepanyan 2023-07-02 19:45:55 +01:00 committed by GitHub
commit 77b6a8e9b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View File

@ -1,14 +1,14 @@
argparse==1.4.0 argparse==1.4.0
netaddr==0.8.0 netaddr==0.8.0
ipaddr==2.2.0 ipaddr==2.2.0
requests==2.28.2 requests==2.31.0
aiohttp==3.8.4 aiohttp==3.8.4
asyncio==3.4.3 asyncio==3.4.3
paramiko==3.1.0 paramiko==3.2.0
texttable==1.6.7 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 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 pyOpenSSL==23.2.0 # library_name=OpenSSL
flask==2.2.5 flask==2.3.2
SQLAlchemy>=1.3.0 # library_name=sqlalchemy SQLAlchemy>=1.3.0 # library_name=sqlalchemy
py3DNS==3.2.1 # library_name=DNS py3DNS==3.2.1 # library_name=DNS
numpy==1.24.3 numpy==1.24.3

View File

@ -3,6 +3,7 @@ This is the utility unit testing module
""" """
import sys import sys
import multiprocessing
import unittest import unittest
from core import utility from core import utility
@ -15,8 +16,7 @@ class UtilityTesting(unittest.TestCase):
""" """
def test_sort_dictonary(self): def test_sort_dictonary(self):
"""Tests if the function sorts the input dictionary.""" """Tests if the function sorts the input dictionary."""
input_dict = { input_dict = {
'a': 1, 'a': 1,
'c': 3, 'c': 3,
@ -31,6 +31,19 @@ class UtilityTesting(unittest.TestCase):
} }
self.assertDictEqual(utility.sort_dictonary(input_dict), sorted_dict) 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__': if __name__ == '__main__':
unittest.main() unittest.main()