Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)