Skip to content

Commit

Permalink
Remove redundant property from processor unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcad committed Dec 19, 2024
1 parent d0906a4 commit 12cdae7
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 38 deletions.
4 changes: 0 additions & 4 deletions tests/unit/processor/concatenator/test_concatenator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ class TestConcatenator(BaseProcessorTestCase):
"tree_config": "tests/testdata/unit/shared_data/tree_config.json",
}

@property
def rules_dirs(self):
return self.CONFIG["rules"]

@pytest.mark.parametrize(
["test_case", "rule", "document", "expected_output"],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ class TestDatetimeExtractor(BaseProcessorTestCase):
"rules": ["tests/testdata/unit/datetime_extractor/rules"],
}

@property
def rules_dirs(self):
return self.CONFIG.get("rules")

def test_an_event_extracted_datetime_utc(self):
timestamp = "2019-07-30T14:37:42.861Z"
document = {"@timestamp": timestamp, "winlog": {"event_id": 123}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ class TestDomainLabelExtractor(BaseProcessorTestCase):
"tree_config": "tests/testdata/unit/shared_data/tree_config.json",
}

@property
def rules_dirs(self):
return self.CONFIG.get("rules")

def test_domain_extraction_from_full_url(self):
document = {"url": {"domain": "https://url.full.domain.de/path/file?param=1"}}
expected_output = {
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/processor/dropper/test_dropper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class TestDropper(BaseProcessorTestCase):
"tree_config": "tests/testdata/unit/shared_data/tree_config.json",
}

@property
def rules_dirs(self):
return self.CONFIG["rules"]

def test_dropper_instantiates(self):
rule = {"filter": "drop_me", "dropper": {"drop": ["drop_me"]}}
self._load_rule(rule)
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/processor/generic_adder/test_generic_adder.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,6 @@ class TestGenericAdder(BaseProcessorTestCase):
"rules": ["tests/testdata/unit/generic_adder/rules"],
}

@property
def rules_dirs(self):
return self.CONFIG.get("rules")

@pytest.mark.parametrize("testcase, rule, event, expected", test_cases)
def test_generic_adder_testcases(
self, testcase, rule, event, expected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ class TestGenericResolver(BaseProcessorTestCase):
"logprep_generic_resolver_cache_load",
]

@property
def rules_dirs(self):
"""Return the paths of the rules"""
return self.CONFIG["rules"]

def test_resolve_generic_instantiates(self):
rule = {"filter": "anything", "generic_resolver": {"field_mapping": {}}}
self._load_rule(rule)
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/processor/geoip_enricher/test_geoip_enricher.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ class TestGeoipEnricher(BaseProcessorTestCase):
"tree_config": "tests/testdata/unit/shared_data/tree_config.json",
}

@property
def rules_dirs(self):
return self.CONFIG["rules"]

def test_geoip_data_added(self):
document = {"client": {"ip": "1.2.3.4"}}

Expand Down
5 changes: 0 additions & 5 deletions tests/unit/processor/labeler/test_labeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ class TestLabeler(BaseProcessorTestCase):
"rules": ["tests/testdata/unit/labeler/rules"],
}

@property
def rules_dirs(self):
"""Return path to rule directories"""
return self.CONFIG["rules"]

def _load_rule(self, rule, schema=None): # pylint: disable=arguments-differ
rule = LabelerRule._create_from_dict(rule)
if schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ class TestTemplateReplacer(BaseProcessorTestCase):
"tree_config": "tests/testdata/unit/shared_data/tree_config.json",
}

@property
def rules_dirs(self):
return self.CONFIG.get("rules")

def setup_method(self):
super().setup_method()
self.object.setup()
Expand Down

0 comments on commit 12cdae7

Please sign in to comment.