blob: 5fd778a6d95d422ddf5498fa855c1241d51fe54d [file] [log] [blame]
from test_base import CfgCheckerTestBase
class TestEntrypoints(CfgCheckerTestBase):
def test_entry_mcp_checker(self):
_module_name = 'cfg_checker.cfg_check'
with self.redirect_output():
_msg, _m = self._safe_import_module(_module_name)
self.assertEqual(
len(_msg),
0,
"Error importing '{}': {}".format(
_module_name,
_msg
)
)
with self.redirect_output():
with self.assertRaises(SystemExit) as ep:
_m.cfg_check.config_check_entrypoint()
self.assertEqual(
ep.exception.code,
0,
"mcp-checker has non-zero exit-code"
)
def test_entry_packages(self):
_module_name = 'cfg_checker.cli.packages'
with self.redirect_output():
_msg, _m = self._safe_import_module(_module_name)
self.assertEqual(
len(_msg),
0,
"Error importing '{}': {}".format(
_module_name,
_msg
)
)
with self.redirect_output():
with self.assertRaises(SystemExit) as ep:
_m.cli.packages.entrypoint()
self.assertEqual(
ep.exception.code,
0,
"packages has non-zero exit code"
)
def test_entry_network(self):
_module_name = 'cfg_checker.cli.network'
with self.redirect_output():
_msg, _m = self._safe_import_module(_module_name)
self.assertEqual(
len(_msg),
0,
"Error importing '{}': {}".format(
_module_name,
_msg
)
)
with self.redirect_output():
with self.assertRaises(SystemExit) as ep:
_m.cli.network.entrypoint()
self.assertEqual(
ep.exception.code,
0,
"network has non-zero exit-code"
)
def test_entry_reclass(self):
_module_name = 'cfg_checker.cli.reclass'
with self.redirect_output():
_msg, _m = self._safe_import_module(_module_name)
self.assertEqual(
len(_msg),
0,
"Error importing '{}': {}".format(
_module_name,
_msg
)
)
with self.redirect_output():
with self.assertRaises(SystemExit) as ep:
_m.cli.reclass.entrypoint()
self.assertEqual(
ep.exception.code,
0,
"reclass has non-zero exit-code"
)