From 1b86e0f122fa31fd633b3362d0dfb6efe3b07825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Srokosz?= Date: Thu, 27 Jul 2023 16:34:18 +0200 Subject: [PATCH] fix tests --- tests/test_matching.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_matching.py b/tests/test_matching.py index 26ff92e..a827c7a 100644 --- a/tests/test_matching.py +++ b/tests/test_matching.py @@ -1,9 +1,15 @@ import unittest from karton.yaramatcher import YaraMatcher, normalize_rule_name -from karton.core.test import KartonTestCase +from karton.core.test import KartonTestCase, ConfigMock from karton.core import Resource, Task +class YaraMatcherConfigMock(ConfigMock): + def __init__(self): + super().__init__() + self._config["yaramatcher"] = {"rules": "tests/testdata/rules"} + + class TestUtils(unittest.TestCase): def test_normalize_rule_name(self) -> None: self.assertEqual("win_remcos", normalize_rule_name("win_remcos_auto")) @@ -14,7 +20,7 @@ def test_normalize_rule_name(self) -> None: class YaraMatcherTestBasic(KartonTestCase): karton_class = YaraMatcher - kwargs = {"yara_rule_dir": "tests/testdata/rules"} + config = YaraMatcherConfigMock() def test_pass(self) -> None: res = Resource("sample", b"z")