Lines Matching refs:path
82 self.assertFalse(os.path.exists(TESTFN))
87 subdirpath = os.path.join(dirpath, 'subdir')
91 self.assertFalse(os.path.exists(dirpath))
100 self.assertFalse(os.path.exists(dirpath))
107 self.assertFalse(os.path.exists(dirpath))
113 sys.path.insert(0, os.curdir)
122 del sys.path[0]
149 parent_dir = os.path.realpath(parent_dir)
152 path = os.path.join(parent_dir, 'temp')
153 self.assertFalse(os.path.isdir(path))
154 with os_helper.temp_dir(path) as temp_path:
155 self.assertEqual(temp_path, path)
156 self.assertTrue(os.path.isdir(path))
157 self.assertFalse(os.path.isdir(path))
162 """Test passing no path."""
164 self.assertTrue(os.path.isdir(temp_path))
165 self.assertFalse(os.path.isdir(temp_path))
169 def call_temp_dir(path):
170 with os_helper.temp_dir(path) as temp_path:
173 path = tempfile.mkdtemp()
174 path = os.path.realpath(path)
176 self.assertTrue(os.path.isdir(path))
177 self.assertRaises(FileExistsError, call_temp_dir, path)
179 self.assertTrue(os.path.isdir(path))
181 shutil.rmtree(path)
185 path = tempfile.mkdtemp()
186 path = os.path.realpath(path)
190 with os_helper.temp_dir(path, quiet=True) as temp_path:
191 self.assertEqual(path, temp_path)
194 self.assertTrue(os.path.isdir(path))
196 shutil.rmtree(path)
201 f'temporary directory {path!r}: '),
225 if not os.path.isdir(temp_path):
245 def call_change_cwd(path):
246 with os_helper.change_cwd(path) as new_cwd:
250 non_existent_dir = os.path.join(parent_dir, 'does_not_exist')
261 bad_dir = os.path.join(parent_dir, 'does_not_exist')
279 path = TESTFN + '_does_not_exist'
281 with os_helper.change_cwd(path=path, quiet=True):
289 f'to {path!r}: '),
297 self.assertEqual(os.path.basename(os.getcwd()), TESTFN)
298 self.assertFalse(os.path.exists(TESTFN))
307 self.assertTrue(os.path.isdir(new_cwd))
332 self.assertIn("foo", sys.path)
333 self.assertIn("bar", sys.path)
334 self.assertNotIn("foo", sys.path)
335 self.assertNotIn("bar", sys.path)