Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Oct 16, 2023
1 parent 85245c6 commit 9d3472b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"python.testing.pytestArgs": [
"tests",
"-v",
"--log-cli-level=DEBUG"
],
"python.analysis.importFormat": "absolute",
"editor.formatOnSave": true,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/processor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def test_field_exists(self):
event = {"a": {"b": "I do not matter"}}
assert self.object._field_exists(event, "a.b")

@mock.patch("logging.Logger.isEnabledFor", return_value=True)
@mock.patch("logging.Logger.debug")
def test_load_rules_with_debug(self, mock_debug):
def test_load_rules_with_debug(self, mock_debug, _):
self.object.load_rules(
specific_rules_targets=self.specific_rules_dirs,
generic_rules_targets=self.generic_rules_dirs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ def generic_rules_dirs(self):
def specific_rules_dirs(self):
return self.CONFIG.get("specific_rules")

def test_events_processed_count(self):
assert self.object.metrics.number_of_processed_events == 0
document = {"foo": "bar"}
for i in range(1, 11):
try:
self.object.process(document)
except ProcessingWarning:
pass
assert self.object.metrics.number_of_processed_events == i

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: 1 addition & 3 deletions tests/unit/processor/generic_adder/test_generic_adder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

from logprep.factory import Factory
from logprep.factory_error import InvalidConfigurationError
from logprep.processor.base.exceptions import (
InvalidRuleDefinitionError,
)
from logprep.processor.base.exceptions import InvalidRuleDefinitionError
from tests.unit.processor.base import BaseProcessorTestCase

RULES_DIR_MISSING = "tests/testdata/unit/generic_adder/rules_missing"
Expand Down

0 comments on commit 9d3472b

Please sign in to comment.