def createTestFile(self): taskList = task.TaskList([task.Task('test') for _ in range(self.nrTasks)]) taskfile = file(self.taskfilename, 'w') taskWriter = persistence.XMLWriter(taskfile) taskWriter.write(taskList, category.CategoryList(), note.NoteContainer(), createDefaultSyncConfig('fake'), 'fake') taskfile.close()
def setUp(self): task.Task.settings = config.Settings(load=False) self.fd = StringIO.StringIO() self.fd.name = 'testfile.tsk' self.writer = persistence.XMLWriter(self.fd) self.task = task.Task() self.taskList = task.TaskList([self.task]) self.category = category.Category('Category') self.categoryContainer = category.CategoryList([self.category]) self.note = note.Note() self.noteContainer = note.NoteContainer([self.note])
def setUp(self): task.Task.settings = config.Settings(load=False) self.fd = StringIO.StringIO() self.fd.name = 'testfile.tsk' self.reader = persistence.XMLReader(self.fd) self.writer = persistence.XMLWriter(self.fd) self.taskList = task.TaskList() self.categories = category.CategoryList() self.notes = note.NoteContainer() self.syncMLConfig = SyncMLConfigNode('root') self.guid = u'GUID' self.fillContainers() tasks, categories, notes, syncMLConfig, guid = self.readAndWrite() self.tasksWrittenAndRead = task.TaskList(tasks) self.categoriesWrittenAndRead = category.CategoryList(categories) self.notesWrittenAndRead = note.NoteContainer(notes) self.syncMLConfigWrittenAndRead = syncMLConfig self.guidWrittenAndRead = guid