Home | History | Annotate | Download | only in test

Lines Matching full:path

3 Tests assume the initial paths in sys.path once the interpreter has begun
27 if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE):
41 """Save a copy of sys.path"""
42 self.sys_path = sys.path[:]
49 """Restore sys.path"""
50 sys.path[:] = self.sys_path
57 # Test makepath() have an absolute path for its first return value
58 # and a case-normalized version of the absolute path for its
61 original_dir = os.path.join(*path_parts)
63 self.assertEqual(os.path.abspath(original_dir), abs_dir)
64 if original_dir == os.path.normcase(original_dir):
67 self.assertEqual(os.path.normcase(abs_dir), norm_dir)
71 for entry in [site.makepath(path)[1] for path in sys.path
72 if path and os.path.isdir(path)]:
74 "%s from sys.path not found in set returned "
81 self.assertIn(site.makepath(pth_file.good_dir_path)[0], sys.path)
82 self.assertFalse(os.path.exists(pth_file.bad_dir_path))
86 # adds directories to sys.path for any line in the file that is not a
101 pth_dir = os.path.abspath(pth_dir)
103 pth_fn = os.path.join(pth_dir, pth_basename)
117 re.escape(os.path.join(pth_dir, pth_fn)))
132 re.escape(os.path.join(pth_dir, pth_fn)))
146 re.escape(os.path.join(pth_dir, pth_fn)))
168 self.assertIn(usersite, sys.path)
172 'import sys; sys.exit(%r in sys.path)' % usersite],
174 self.assertEqual(rc, 1, "%r is not in sys.path (sys.exit returned %r)"
179 'import sys; sys.exit(%r in sys.path)' % usersite],
186 'import sys; sys.exit(%r in sys.path)' % usersite],
229 wanted = os.path.join('xoxo', 'Lib', 'site-packages')
237 wanted = os.path.join('/Library',
245 wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
248 wanted = os.path.join('xoxo', 'lib', 'site-python')
254 wanted = os.path.join('xoxo', 'lib', 'site-packages')
264 self.base_dir = os.path.abspath('')
265 self.file_path = os.path.join(self.base_dir, self.filename)
269 self.good_dir_path = os.path.join(self.base_dir, self.good_dirname)
270 self.bad_dir_path = os.path.join(self.base_dir, self.bad_dirname)
298 if os.path.exists(self.file_path):
307 if os.path.exists(self.good_dir_path):
309 if os.path.exists(self.bad_dir_path):
316 """Make a copy of sys.path"""
317 self.sys_path = sys.path[:]
320 """Restore sys.path"""
321 sys.path[:] = self.sys_path
325 # as an absolute path.
330 self.assertTrue(os.path.isabs(module.__file__), repr(module))
335 # be testing things loaded *after* test_site did path normalization
338 # No duplicate paths should exist in sys.path
342 for path in sys.path:
343 self.assertNotIn(path, seen_paths)
344 seen_paths.add(path)