1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

fix for more graceful handling of missing optional libraries

This commit is contained in:
Kelly Brazil
2024-02-10 11:16:38 -08:00
parent e6bdbb42d3
commit d3e7f09ca3
16 changed files with 325 additions and 199 deletions

View File

@ -11,6 +11,12 @@ class MyTests(unittest.TestCase):
p = jc.lib.get_parser('arp')
self.assertIsInstance(p, ModuleType)
def test_lib_get_parser_broken_parser(self):
"""get_parser substitutes the disabled_parser if a parser is broken"""
broken = jc.lib.get_parser('broken_parser')
disabled = jc.lib.get_parser('disabled_parser')
self.assertIs(broken, disabled)
def test_lib_get_parser_module(self):
p = jc.lib.get_parser(csv_parser)
self.assertIsInstance(p, ModuleType)