Пример #1
0
 def test_chdir(self):
     testfn = self.get_testfn()
     base = os.getcwd()
     os.mkdir(testfn)
     with chdir(testfn):
         self.assertEqual(os.getcwd(), os.path.join(base, testfn))
     self.assertEqual(os.getcwd(), base)
Пример #2
0
 def test_proc_cwd(self):
     safe_mkdir(self.funky_name)
     with chdir(self.funky_name):
         p = psutil.Process()
         cwd = p.cwd()
     self.assertIsInstance(p.cwd(), str)
     if self.expect_exact_path_match():
         self.assertEqual(cwd, self.funky_name)
Пример #3
0
 def test_proc_cwd(self):
     safe_mkdir(self.funky_name)
     with chdir(self.funky_name):
         p = psutil.Process()
         cwd = p.cwd()
     self.assertIsInstance(p.cwd(), str)
     if self.expect_exact_path_match():
         self.assertEqual(cwd, self.funky_name)
Пример #4
0
 def test_proc_cwd(self):
     dname = self.funky_name + "2"
     self.addCleanup(safe_rmpath, dname)
     safe_mkdir(dname)
     with chdir(dname):
         p = psutil.Process()
         cwd = p.cwd()
     self.assertIsInstance(p.cwd(), str)
     if self.expect_exact_path_match():
         self.assertEqual(cwd, dname)
Пример #5
0
 def test_proc_cwd(self):
     dname = self.funky_name + "2"
     self.addCleanup(safe_rmpath, dname)
     safe_mkdir(dname)
     with chdir(dname):
         p = psutil.Process()
         cwd = p.cwd()
     self.assertIsInstance(p.cwd(), str)
     if self.expect_exact_path_match():
         self.assertEqual(cwd, dname)
Пример #6
0
 def test_chdir(self):
     base = os.getcwd()
     os.mkdir(TESTFN)
     with chdir(TESTFN):
         self.assertEqual(os.getcwd(), os.path.join(base, TESTFN))
     self.assertEqual(os.getcwd(), base)
Пример #7
0
 def test_chdir(self):
     base = os.getcwd()
     os.mkdir(TESTFN)
     with chdir(TESTFN):
         self.assertEqual(os.getcwd(), os.path.join(base, TESTFN))
     self.assertEqual(os.getcwd(), base)