diff --git a/tests/test_backdoor_detection.py b/tests/test_backdoor_detection.py index ebbcd58..d366df1 100644 --- a/tests/test_backdoor_detection.py +++ b/tests/test_backdoor_detection.py @@ -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()