Esempio n. 1
0
 def test_transform_path_to_file(self):
     file_path = Path(self.file_str)
     # Non-existent paths don't get transformed to File.
     self.assertTrue(isinstance(file_path.transform(), Path))
Esempio n. 2
0
 def test_transform_path_to_dir(self):
     dir_path = Path(self.path_str)
     # Non-existent paths don't get transformed to Dir.
     self.assertTrue(isinstance(dir_path.transform(), Path))
Esempio n. 3
0
 def test_abs_path(self):
     d = Path(self.temp_dir).transform()
     self.assertTrue(isinstance(d, Dir))
     pathabs = str(d.abspath())
     osabs = os.path.join(os.getcwd(), self.temp_dir)
     self.assertEqual(pathabs, osabs)
Esempio n. 4
0
 def test_transform_path_to_file(self):
     file_path = Path(self.filename)
     self.assertEqual(file_path.transform(), File(self.filename))
     # Comparing equality of Path and File only compares their string paths.
     # Check that object was properly transformed using isinstance.
     self.assertTrue(isinstance(file_path.transform(), File))
Esempio n. 5
0
 def test_transform_path_to_dir(self):
     dir_path = Path(self.temp_dir)
     self.assertEqual(dir_path.transform(), Dir(self.temp_dir))
     # Comparing equality of Path and Dir only compares their string paths.
     # Check that object was properly transformed using isinstance.
     self.assertTrue(isinstance(dir_path.transform(), Dir))