Move importlib completely over to using rpartition and accepting the empty

string for top-level modules.
This commit is contained in:
Brett Cannon 2009-02-07 01:52:25 +00:00
parent d94e558fdc
commit 06c9d96b70
4 changed files with 22 additions and 15 deletions

View file

@ -21,7 +21,8 @@ class LoaderTests(abc.LoaderTests):
with util.uncache(test_path_hook.NAME):
module = self.load_module(test_path_hook.NAME)
for attr, value in [('__name__', test_path_hook.NAME),
('__file__', test_path_hook.FILEPATH)]:
('__file__', test_path_hook.FILEPATH),
('__package__', '')]:
self.assertEqual(getattr(module, attr), value)
self.assert_(test_path_hook.NAME in sys.modules)