def METHOD_NAME(self, package_as_None=False):
    # [__name__]
    globals_ = {'__name__': 'pkg.fake', '__path__': []}
    if package_as_None:
        globals_['__package__'] = None
    with self.mock_modules('pkg.__init__', 'pkg.fake') as importer:
        with util.import_state(meta_path=[importer]):
            self.__import__('pkg.fake')
            module = self.__import__('', globals= globals_,
                                            fromlist=['attr'], level=2)
        self.assertEqual(module.__name__, 'pkg')