def test_get_imported_module_from_file(self): imported_module = utils.get_imported_module_from_file("tests/data/debugtalk.py") self.assertIn("gen_md5", dir(imported_module)) functions_dict = utils.filter_module(imported_module, "function") self.assertIn("gen_md5", functions_dict) self.assertNotIn("PYTHON_VERSION", functions_dict) with self.assertRaises(exception.FileNotFoundError): utils.get_imported_module_from_file("tests/data/debugtalk2.py")
def test_get_imported_module_from_file(self): imported_module = utils.get_imported_module_from_file("tests/debugtalk.py") self.assertIn("gen_md5", dir(imported_module)) functions_dict = utils.filter_module(imported_module, "function") self.assertIn("gen_md5", functions_dict) self.assertNotIn("urllib", functions_dict) with self.assertRaises(exception.FileNotFoundError): utils.get_imported_module_from_file("tests/debugtalk2.py")