Exemple #1
0
 def test_get_library_path(self):
     import sys
     import os
     sys.path.append(self.goal_dir)
     try:
         import app_main
         app_main.os = os
         newpath = app_main.get_library_path('/tmp/pypy-c') # stdlib not found
         assert newpath == sys.path
         newpath = app_main.get_library_path(self.fake_exe)
         # we get at least 'expected_path', and maybe more (e.g.plat-linux2)
         assert newpath[:len(self.expected_path)] == self.expected_path
     finally:
         sys.path.pop()
Exemple #2
0
 def test_get_library_path(self):
     import sys
     import os
     sys.path.append(self.goal_dir)
     try:
         import app_main
         app_main.os = os
         newpath = app_main.get_library_path(
             '/tmp/pypy-c')  # stdlib not found
         assert newpath == sys.path
         newpath = app_main.get_library_path(self.fake_exe)
         if newpath[0].endswith('__extensions__'):
             newpath = newpath[1:]
         # we get at least 'expected_path', and maybe more (e.g.plat-linux2)
         assert newpath[:len(self.expected_path)] == self.expected_path
     finally:
         sys.path.pop()
Exemple #3
0
 def test_trunk_can_be_prefix(self):
     import sys
     import os
     sys.path.append(self.goal_dir)
     try:
         import app_main
         app_main.os = os
         pypy_c = os.path.join(self.trunkdir, 'pypy', 'translator', 'goal', 'pypy-c')
         newpath = app_main.get_library_path(pypy_c)
         # we get at least lib_pypy, lib-python/modified-X.Y.Z,
         # lib-python/X.Y.Z, and maybe more (e.g. plat-linux2)
         assert len(newpath) >= 3
         for p in newpath:
             assert p.startswith(self.trunkdir)
     finally:
         sys.path.pop()
Exemple #4
0
 def test_trunk_can_be_prefix(self):
     import sys
     import os
     sys.path.append(self.goal_dir)
     try:
         import app_main
         app_main.os = os
         pypy_c = os.path.join(self.trunkdir, 'pypy', 'translator', 'goal',
                               'pypy-c')
         newpath = app_main.get_library_path(pypy_c)
         # we get at least lib_pypy
         # lib-python/X.Y.Z, and maybe more (e.g. plat-linux2)
         assert len(newpath) >= 2
         for p in newpath:
             assert p.startswith(self.trunkdir)
     finally:
         sys.path.pop()