Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 committed Jul 27, 2023
1 parent 01ba8ca commit 1b86e0f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_matching.py
Original file line number Diff line number Diff line change
@@ -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"))
Expand All @@ -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")
Expand Down

0 comments on commit 1b86e0f

Please sign in to comment.