From a9cf4cc19b4768587ff005dc75d7cd1a6a5bbd3c Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Fri, 12 Jul 2024 10:55:38 +0300 Subject: [PATCH] testfix --- tests/data/depth_3.json | 8 ++++---- tests/test_main.py | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/data/depth_3.json b/tests/data/depth_3.json index 92ed7c4c1..1656125d4 100644 --- a/tests/data/depth_3.json +++ b/tests/data/depth_3.json @@ -7610,7 +7610,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.78, + "ml_probability": 0.756, "rule": "Github Old Token", "severity": "high", "confidence": "moderate", @@ -7637,7 +7637,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.78, + "ml_probability": 0.756, "rule": "Token", "severity": "medium", "confidence": "moderate", @@ -7650,8 +7650,8 @@ "value": "gireogicracklecrackle1231567190113413981", "value_start": 15, "value_end": 55, - "variable": "ngit_token", - "variable_start": 1, + "variable": "git_token", + "variable_start": 2, "variable_end": 11, "entropy_validation": { "iterator": "BASE36_CHARS", diff --git a/tests/test_main.py b/tests/test_main.py index e5b1254d7..915477ee7 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -795,14 +795,16 @@ def test_param_n(self) -> None: cred_sweeper = CredSweeper() cred_sweeper.run(content_provider=content_provider) creds = cred_sweeper.credential_manager.get_credentials() - self.assertFalse(len(creds), [x.to_json() for x in creds]) + self.assertEqual(0, len(creds), [x.to_json(False, False) for x in creds]) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # def test_param_p(self) -> None: # internal parametrized tests for quick debug items = [ # - ("log.txt", b'json\\nAuthorization: Basic jfhlksadjiu9813ryiuhdfskadjlkjh34\\n\\u003c/code\\u003e\\u003c/pre\\u003e"', + ("slt.py", b'\\t\\tsalt = "\\x187bhgerjhqw\\n iKa\\tW_R~0/8"', "salt", "\\x187bhgerjhqw\\n iKa\\tW_R~0/8"), + ("log.txt", + b'json\\nAuthorization: Basic jfhlksadjiu9813ryiuhdfskadjlkjh34\\n\\u003c/code\\u003e\\u003c/pre\\u003e"', "Authorization", "jfhlksadjiu9813ryiuhdfskadjlkjh34"), ("pwd.py", b'password = "ji3_8iKgaW_R~0/8"', "password", "ji3_8iKgaW_R~0/8"), ("pwd.py", b'password = "/_tcTz