Пример #1
0
 def test_chdir(self):
     cwd = Path.cwd()
     try:
         self.assertIsNone(self.tpath.chdir())
         self.assertEqual(os.getcwd(), self.tdir)
         self.assertRaises((IOError, OSError),
                           Path('chdir.n').chdir)  # dir that doesn't exist
     finally:
         cwd.chdir()
Пример #2
0
 def test_cwd(self):
     scd = os.path.abspath(os.curdir)
     sd = os.getcwd()
     srd = os.path.abspath(sd)
     here = Path.cwd()
     self.assertIsInstance(here, Path)
     self.assertEqual(scd, srd)
     self.assertEqual(here.value, scd)
     self.assertEqual(Path('foo').cwd().value, scd)