diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-10-02 07:14:50 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-10-02 07:14:50 (GMT) |
commit | 1b991b5c66cc44b6f93a14c1c265683074224004 (patch) | |
tree | 0f05b9daad87d85c9318fe28ef0d2f8a787b0b37 /tests/analysis/scan | |
parent | e662be152d0b2fe0d1626a845121db5f1a51d9aa (diff) |
Implement Base64 encoding for scan pattern modifications.
Diffstat (limited to 'tests/analysis/scan')
-rw-r--r-- | tests/analysis/scan/pyapi.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/analysis/scan/pyapi.py b/tests/analysis/scan/pyapi.py index 8764074..2aaaeec 100644 --- a/tests/analysis/scan/pyapi.py +++ b/tests/analysis/scan/pyapi.py @@ -73,6 +73,7 @@ class TestRostPythonAPI(ChrysalideTestCase): self.assertEqual(source, transformed[0]) + mod = find_token_modifiers_for_name('hex') self.assertIsNotNone(mod) @@ -81,6 +82,7 @@ class TestRostPythonAPI(ChrysalideTestCase): self.assertEqual(binascii.hexlify(source), transformed[0]) + mod = find_token_modifiers_for_name('rev') self.assertIsNotNone(mod) @@ -90,6 +92,18 @@ class TestRostPythonAPI(ChrysalideTestCase): self.assertEqual(source[::-1], transformed[0]) + mod = find_token_modifiers_for_name('base64') + self.assertIsNotNone(mod) + + source = b'ABC' + transformed = mod.transform(source) + + self.assertEqual(len(transformed), 3) + self.assertEqual(transformed[0], b'QUJD') + self.assertEqual(transformed[1], b'FCQw') + self.assertEqual(transformed[2], b'BQkM') + + def testBytePatternModifiersAPI(self): """Validate the API for pattern modifiers.""" |