aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2022-09-14 22:46:59 +0200
committerJake Hunsaker <jhunsake@redhat.com>2022-09-15 10:38:53 -0400
commit11317c6a8077026891c4a3c178510bcaf98b8800 (patch)
tree1610351fd2a6f4c9ff781b1ec0a1f3f120775954 /tests
parentaf9727c3918731f74b0cda297299274a35c40c89 (diff)
downloadsos-11317c6a8077026891c4a3c178510bcaf98b8800.tar.gz
[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 <pmoravec@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/cleaner_tests.py8
1 files changed, 7 insertions, 1 deletions
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]