def test_move(self): f = File("hello") f.createFile() f.moveFile("newdest") self.assertTrue(f.exists()) self.assertEqual(f.getPath().path, "newdest") oldFile = File("hello") self.assertFalse(oldFile.exists()) f.removeFile() self.assertFalse(f.exists())
def organize(self, filesToMoveIn=None): self._checkDirectoryExists() notesPath = self._path.getAbsolutePath() latexNotes = LatexNotes(self._fields) latexNotes.createAllContent() latexNotes.writeContent(notesPath) title = self._fields.getField("title") infofile = Infofile() infofile.title = title infofile.writeContent(self.infofilePath()) if(filesToMoveIn is not None): for file in filesToMoveIn: f = file if(type(file) != File): f = File(file) f.moveFile(self._path.getAbsolutePath())