Пример #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))
Пример #2
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))
Пример #3
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))
Пример #4
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))