Exemple #1
0
 def testNoPackageAtAll(self):
     module = self.CreateModule('__main__')
     self.assertPackageEquals('__main__', util.get_package_for_module(module))
Exemple #2
0
 def testNoExtension(self):
     module = self.CreateModule('__main__')
     module.__file__ = '/bing/blam/bloom/blarm/my_file'
     self.assertPackageEquals('my_file', util.get_package_for_module(module))
Exemple #3
0
 def testIsMainCompiled(self):
     module = self.CreateModule('__main__')
     module.__file__ = '/bing/blam/bloom/blarm/my_file.pyc'
     self.assertPackageEquals('my_file', util.get_package_for_module(module))
Exemple #4
0
 def testHasModuleName(self):
     module = self.CreateModule('service_module')
     self.assertPackageEquals('service_module',
                              util.get_package_for_module(module))
Exemple #5
0
 def testHasPackage(self):
     module = self.CreateModule('service_module')
     module.package = 'my_package'
     self.assertPackageEquals('my_package', util.get_package_for_module(module))
Exemple #6
0
 def testModuleNameNotInSys(self):
     self.assertPackageEquals(None,
                              util.get_package_for_module('service_module'))