diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2021-07-12 11:28:58 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2021-07-29 11:45:37 -0400 |
commit | ad6a92a8adaaac786421746224033fc34cd989d1 (patch) | |
tree | 6d92525666963250da4ed4f0148e97aea2155728 /tests | |
parent | d905390230bc191b486e30207a61453a346bea3f (diff) | |
download | sos-ad6a92a8adaaac786421746224033fc34cd989d1.tar.gz |
[cleaner] Read map file only once for parsers
Instead of re-reading the mapping file for each parser, read it once and
store the contents, then hand those contents over to each parser.
This allows us to side-step handling the same exception for malformed
config files over and over for each parser loaded.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/cleaner_tests.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unittests/cleaner_tests.py b/tests/unittests/cleaner_tests.py index 5510dd80..cb20772f 100644 --- a/tests/unittests/cleaner_tests.py +++ b/tests/unittests/cleaner_tests.py @@ -100,11 +100,11 @@ class CleanerMapTests(unittest.TestCase): class CleanerParserTests(unittest.TestCase): def setUp(self): - self.ip_parser = SoSIPParser() - self.mac_parser = SoSMacParser() - self.host_parser = SoSHostnameParser(opt_domains='foobar.com') - self.kw_parser = SoSKeywordParser(keywords=['foobar']) - self.kw_parser_none = SoSKeywordParser() + self.ip_parser = SoSIPParser(config={}) + self.mac_parser = SoSMacParser(config={}) + self.host_parser = SoSHostnameParser(config={}, opt_domains='foobar.com') + self.kw_parser = SoSKeywordParser(config={}, keywords=['foobar']) + self.kw_parser_none = SoSKeywordParser(config={}) def test_ip_parser_valid_ipv4_line(self): line = 'foobar foo 10.0.0.1/24 barfoo bar' |