Exemplo n.º 1
0
 def test_transform_file_to_path(self):
     file_ = File(self.file_str)
     self.assertEqual(file_.transform(), Path(self.file_str))
     self.assertTrue(isinstance(file_.transform(), Path))
Exemplo n.º 2
0
 def test_remove(self):
     f = File(self.filename)
     f.remove()
     self.assertTrue(not os.path.exists(self.filename))
     # Recreate the file so that teardown doesn't raise an error.
     f.touch()
Exemplo n.º 3
0
 def test_touch(self):
     f = File(self.filename)
     f.touch()
     self.assertTrue(os.path.exists(self.filename))
     self.assertEqual(f.open().read(), "")
     os.remove(self.filename)
Exemplo n.º 4
0
 def test_path(self):
     f = File(self.filename)
     self.assertEqual(f.abspath()[:-1], self.testdir)