From 11317c6a8077026891c4a3c178510bcaf98b8800 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Wed, 14 Sep 2022 22:46:59 +0200 Subject: [tests] Add a test for stripping '_' by hostname parser - test for #3022 . - fixup of opt_parser being a tuple with a string Relates: #3022 Signed-off-by: Pavel Moravec --- tests/unittests/cleaner_tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/unittests/cleaner_tests.py b/tests/unittests/cleaner_tests.py index 39f81a78..d27481c1 100644 --- a/tests/unittests/cleaner_tests.py +++ b/tests/unittests/cleaner_tests.py @@ -102,7 +102,8 @@ class CleanerParserTests(unittest.TestCase): def setUp(self): self.ip_parser = SoSIPParser(config={}) self.mac_parser = SoSMacParser(config={}) - self.host_parser = SoSHostnameParser(config={}, opt_domains='foobar.com') + self.host_parser = SoSHostnameParser(config={}, + opt_domains=['foobar.com']) self.kw_parser = SoSKeywordParser(config={}, keywords=['foobar']) self.kw_parser_none = SoSKeywordParser(config={}) self.kw_parser.generate_item_regexes() @@ -171,6 +172,11 @@ class CleanerParserTests(unittest.TestCase): _test = self.host_parser.parse_line(line)[0] self.assertNotEqual(line, _test) + def test_hostname_no_obfuscate_underscore(self): + line = 'pam_env.so _why.not_' + _test = self.host_parser.parse_line(line)[0] + self.assertEqual(line, _test) + def test_keyword_parser_valid_line(self): line = 'this is my foobar test line' _test = self.kw_parser.parse_line(line)[0] -- cgit