예제 #1
0
 def testAbsolutePackageImport(self):
     """Test that the a/aa/__init__ module is found when the a/aa module is imported relatively
     from a file in that folder."""
     self.buildTempDirs()
     expected = os.path.join(self.temp_fake_aa, "__init__")
     aaeggs = os.path.join(self.temp_fake_aa, "eggs.py")
     self.assertEqual(expected, modulefinder.get_module_filename("aa", aaeggs))
예제 #2
0
 def testAbsolutePackageImport(self):
     """Test that the a/aa/__init__ module is found when the a/aa module is imported relatively
     from a file in that folder."""
     self.buildTempDirs()
     expected = os.path.join(self.temp_fake_aa, '__init__')
     aaeggs = os.path.join(self.temp_fake_aa, 'eggs.py')
     self.assertEqual(expected, modulefinder.get_module_filename('aa', aaeggs))
예제 #3
0
 def testPynocleImportsPynocle(self):
     """Test that importing pynocle works from a folder in the pynocle folder."""
     self.buildTempDirs()
     expected = os.path.join(THISDIR, '__init__')
     self.assertEqual(expected, modulefinder.get_module_filename('pynocle', __file__))
예제 #4
0
 def testFindAASpamAbs(self):
     """Test that the a/aa/spam.py module is found when the a/aa/eggs.py module is importing it absolutely."""
     self.buildTempDirs()
     expected = os.path.join(self.temp_fake_aa, 'spam')
     aaeggs = os.path.join(self.temp_fake_aa, 'eggs.py')
     self.assertEqual(expected, modulefinder.get_module_filename('_fake.a.aa.spam', aaeggs))
예제 #5
0
 def testRelativeImport(self):
     """Test that the a/aa/spam.py module is found when the a/aa/eggs.py module is importing it relatively."""
     self.buildTempDirs()
     expected = os.path.join(self.temp_fake_aa, 'spam')
     aaeggs = os.path.join(self.temp_fake_aa, 'eggs.py')
     self.assertEqual(expected, modulefinder.get_module_filename('spam', aaeggs))
예제 #6
0
 def testFindsBuiltins(self):
     """Test that it returns only the modulename for builtin modules."""
     self.assertEqual('sys', modulefinder.get_module_filename('sys'))
     self.assertEqual('time', modulefinder.get_module_filename('time'))
예제 #7
0
 def testPynocleImportsPynocle(self):
     """Test that importing pynocle works from a folder in the pynocle folder."""
     self.buildTempDirs()
     expected = os.path.join(THISDIR, "__init__")
     self.assertEqual(expected, modulefinder.get_module_filename("pynocle", __file__))
예제 #8
0
 def testFindAASpamAbs(self):
     """Test that the a/aa/spam.py module is found when the a/aa/eggs.py module is importing it absolutely."""
     self.buildTempDirs()
     expected = os.path.join(self.temp_fake_aa, "spam")
     aaeggs = os.path.join(self.temp_fake_aa, "eggs.py")
     self.assertEqual(expected, modulefinder.get_module_filename("_fake.a.aa.spam", aaeggs))
예제 #9
0
 def testRelativeImport(self):
     """Test that the a/aa/spam.py module is found when the a/aa/eggs.py module is importing it relatively."""
     self.buildTempDirs()
     expected = os.path.join(self.temp_fake_aa, "spam")
     aaeggs = os.path.join(self.temp_fake_aa, "eggs.py")
     self.assertEqual(expected, modulefinder.get_module_filename("spam", aaeggs))
예제 #10
0
 def testFindsBuiltins(self):
     """Test that it returns only the modulename for builtin modules."""
     self.assertEqual("sys", modulefinder.get_module_filename("sys"))
     self.assertEqual("time", modulefinder.get_module_filename("time"))