def test_package_sidepackage(self) -> None: manager = test_utils.brainless_manager() assert "package.sidepackage" not in MANAGER.astroid_cache package = manager.ast_from_module_name("absimp") self.assertIsInstance(package, nodes.Module) self.assertTrue(package.package) subpackage = next(package.getattr("sidepackage")[0].infer()) self.assertIsInstance(subpackage, nodes.Module) self.assertTrue(subpackage.package) self.assertEqual(subpackage.name, "absimp.sidepackage")
def test_module_path(self) -> None: man = test_utils.brainless_manager() mod = man.ast_from_module_name("package.import_package_subpackage_module") package = next(mod.igetattr("package")) self.assertEqual(package.name, "package") subpackage = next(package.igetattr("subpackage")) self.assertIsInstance(subpackage, nodes.Module) self.assertTrue(subpackage.package) self.assertEqual(subpackage.name, "package.subpackage") module = next(subpackage.igetattr("module")) self.assertEqual(module.name, "package.subpackage.module")
def setUp(self) -> None: self.manager = test_utils.brainless_manager() self.builder = builder.AstroidBuilder(self.manager)
def setUp(self) -> None: super().setUp() self.manager = test_utils.brainless_manager()