2009-01-22 18:43:07 -04:00
|
|
|
from importlib import machinery
|
2009-01-17 20:24:28 -04:00
|
|
|
from ..builtin import test_loader
|
|
|
|
|
|
|
|
|
|
|
|
class LoaderTests(test_loader.LoaderTests):
|
|
|
|
|
|
|
|
name = '__phello__'
|
|
|
|
load_module = staticmethod(lambda name:
|
2009-01-22 18:43:07 -04:00
|
|
|
machinery.FrozenImporter.load_module(name))
|
2009-01-17 20:24:28 -04:00
|
|
|
verification = {'__name__': '__phello__', '__file__': '<frozen>',
|
|
|
|
'__package__': None, '__path__': ['__phello__']}
|
|
|
|
|
|
|
|
|
|
|
|
class SubmoduleLoaderTests(LoaderTests):
|
|
|
|
|
|
|
|
name = '__phello__.spam'
|
|
|
|
verification = {'__name__': '__phello__.spam', '__file__': '<frozen>',
|
|
|
|
'__package__': None}
|
|
|
|
|
|
|
|
|
|
|
|
def test_main():
|
|
|
|
from test.support import run_unittest
|
|
|
|
run_unittest(LoaderTests, SubmoduleLoaderTests)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
test_main()
|