コード例 #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
ファイル: test_unicode.py プロジェクト: AiratNig/psutil
 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
ファイル: test_unicode.py プロジェクト: giampaolo/psutil
 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
ファイル: test_misc.py プロジェクト: nicolargo/psutil
 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)