-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tst: update gethostbyname expert data
changed IP address of example.com and example.org
- Loading branch information
Showing
2 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# SPDX-FileCopyrightText: 2024 Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
# -*- coding: utf-8 -*- | ||
|
||
import unittest | ||
|
||
import intelmq.lib.test as test | ||
from intelmq.bots.experts.filter.expert import FilterExpertBot | ||
|
||
EXAMPLE_INPUT = {"__type": "Event", | ||
"source.tor_node": True, | ||
} | ||
EXAMPLE_INPUT1 = {"__type": "Report", | ||
"source.tor_node": False, | ||
} | ||
|
||
|
||
class TestFilterExpertBot(test.BotTestCase, unittest.TestCase): | ||
""" | ||
A simple TestCase for FilterExpertBot handling True / False and keep / drop. | ||
""" | ||
|
||
@classmethod | ||
def set_bot(cls): | ||
cls.bot_reference = FilterExpertBot | ||
cls.input_message = EXAMPLE_INPUT | ||
cls.sysconfig = {'filter_key': 'source.tor_node', | ||
'filter_value': True, | ||
'filter_action': 'drop'} | ||
|
||
def test_extra_filter_drop(self): | ||
self.run_bot() | ||
self.assertOutputQueueLen(0) | ||
|
||
def test_extra_filter_keep(self): | ||
self.input_message = EXAMPLE_INPUT1 | ||
self.run_bot() | ||
self.assertMessageEqual(0, EXAMPLE_INPUT1) | ||
|
||
|
||
if __name__ == '__main__': # pragma: no cover | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters