Compare commits
2 Commits
40f5c07fa1
...
e418bbf380
Author | SHA1 | Date | |
---|---|---|---|
e418bbf380 | |||
d30ea0ca61 |
@ -3,3 +3,4 @@ requests
|
||||
packaging
|
||||
openai
|
||||
bs4
|
||||
uncompyle6
|
@ -90,6 +90,23 @@ class TestBackdoorDetection(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
detectGPT(content)
|
||||
|
||||
def test_find_dangerous_functions_pyc(self):
|
||||
file_content = """import os
|
||||
os.system('rm -rf /')
|
||||
"""
|
||||
file_extension = ".pyc"
|
||||
|
||||
expected_result = {
|
||||
"high": [(2, "os.system('rm -rf /')")],
|
||||
"medium": [],
|
||||
"low": [],
|
||||
"none": [],
|
||||
}
|
||||
|
||||
result = find_dangerous_functions(file_content, file_extension)
|
||||
|
||||
self.assertEqual(result, expected_result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user