From dc89f9926885724000d3ae12ee0516e9a5cea22c Mon Sep 17 00:00:00 2001 From: Piotr Pauksztelo Date: Wed, 18 Dec 2024 09:24:57 +0100 Subject: [PATCH] Fix geoip enricher unit test --- .../{geoip_all_1.json => geoip_all.json} | 0 .../geoip_enricher/rules/geoip_all_2.json | 21 ------------------- .../geoip_enricher/test_geoip_enricher.py | 1 - 3 files changed, 22 deletions(-) rename tests/testdata/unit/geoip_enricher/rules/{geoip_all_1.json => geoip_all.json} (100%) delete mode 100644 tests/testdata/unit/geoip_enricher/rules/geoip_all_2.json diff --git a/tests/testdata/unit/geoip_enricher/rules/geoip_all_1.json b/tests/testdata/unit/geoip_enricher/rules/geoip_all.json similarity index 100% rename from tests/testdata/unit/geoip_enricher/rules/geoip_all_1.json rename to tests/testdata/unit/geoip_enricher/rules/geoip_all.json diff --git a/tests/testdata/unit/geoip_enricher/rules/geoip_all_2.json b/tests/testdata/unit/geoip_enricher/rules/geoip_all_2.json deleted file mode 100644 index 60dd51013..000000000 --- a/tests/testdata/unit/geoip_enricher/rules/geoip_all_2.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "filter": "specific.client.ip AND NOT winlog.computer_name", - "geoip_enricher": { - "source_fields": [ - "client.ip" - ] - }, - "description": "" - }, - { - "filter": "specific.source.ip", - "geoip_enricher": { - "source_fields": [ - "source.ip" - ], - "target_field": "source.geo.ip" - }, - "description": "" - } -] \ No newline at end of file diff --git a/tests/unit/processor/geoip_enricher/test_geoip_enricher.py b/tests/unit/processor/geoip_enricher/test_geoip_enricher.py index 9ab1cea26..c96817bc1 100644 --- a/tests/unit/processor/geoip_enricher/test_geoip_enricher.py +++ b/tests/unit/processor/geoip_enricher/test_geoip_enricher.py @@ -119,7 +119,6 @@ def test_no_geoip_data_added_if_source_field_is_none(self): def test_source_field_is_none_emits_missing_fields_warning(self): document = {"client": {"ip": None}} expected = {"client": {"ip": None}, "tags": ["_geoip_enricher_missing_field_warning"]} - self._load_rule(self.object.rules[0]) self.object.process(document) assert document == expected assert len(self.object.result.warnings) == 1