コード例 #1
0
ファイル: test.py プロジェクト: dfraser74/taskcoach
 def tearDown(self):
     # Prevent processing of pending events after the test has finished:
     wx.GetApp().Disconnect(wx.ID_ANY)
     from taskcoachlib import patterns
     patterns.Publisher().clear()
     patterns.CommandHistory().clear()
     patterns.NumberedInstances.count = dict()
     from taskcoachlib.domain import date
     date.Clock().reset()
     if hasattr(self, 'events'):
         del self.events
     super(TestCase, self).tearDown()
コード例 #2
0
ファイル: test.py プロジェクト: casics/extractor
 def tearDown(self):
     # pylint: disable=W0404
     # Prevent processing of pending events after the test has finished:
     wx.GetApp().Disconnect(wx.ID_ANY)
     from taskcoachlib import patterns
     patterns.Publisher().clear()
     patterns.CommandHistory().clear()
     patterns.NumberedInstances.count = dict()
     from taskcoachlib.domain import date
     date.Scheduler().shutdown(False, False)
     date.Scheduler.deleteInstance()
     if hasattr(self, 'events'):
         del self.events
     from taskcoachlib.thirdparty.pubsub import pub
     pub.unsubAll()
     super(TestCase, self).tearDown()
コード例 #3
0
 def testUndoMarkCompletedWhenFilteringCompletedTasks(self):
     self.viewer.hideCompletedTasks()
     child1 = task.Task('child1')
     child2 = task.Task('child2')
     grandChild = task.Task('grandChild')
     self.task.addChild(child1)
     self.task.addChild(child2)
     child2.addChild(grandChild)
     self.taskList.append(self.task)
     self.viewer.expandAll()
     self.assertEqual(4, self.viewer.size())
     markCompletedCommand = command.MarkCompletedCommand(
         self.taskList, [grandChild])
     markCompletedCommand.do()
     self.assertEqual(2, self.viewer.size())
     patterns.CommandHistory().undo()
     self.assertEqual(4, self.viewer.size())
コード例 #4
0
 def testUndoMarkCompletedWhenFilteringCompletedTasks(self):
     self.settings.setboolean(
         'behavior', 'markparentcompletedwhenallchildrencompleted', True)
     self.viewer.hideTaskStatus(task.status.completed)
     child1 = task.Task('child1')
     child2 = task.Task('child2')
     grandChild = task.Task('grandChild')
     self.task.addChild(child1)
     self.task.addChild(child2)
     child2.addChild(grandChild)
     self.taskList.append(self.task)
     self.viewer.expandAll()
     self.assertEqual(4, self.viewer.size())
     markCompletedCommand = command.MarkCompletedCommand(
         self.taskList, [grandChild])
     markCompletedCommand.do()
     self.assertEqual(2, self.viewer.size())
     patterns.CommandHistory().undo()
     self.assertEqual(4, self.viewer.size())
コード例 #5
0
ファイル: iocontroller.py プロジェクト: casics/extractor
 def __closeUnconditionally(self):
     self.__messageCallback(_('Closed %s') % self.__taskFile.filename())
     self.__taskFile.close()
     patterns.CommandHistory().clear()
     gc.collect()
コード例 #6
0
 def testCannotDropOnGrandchild(self):
     self.dragAndDrop([self.grandchild], [self.parent])
     self.failIf(patterns.CommandHistory().hasHistory())
コード例 #7
0
 def testSingleton(self):
     another = patterns.CommandHistory()
     self.failUnless(self.commands is another)
コード例 #8
0
 def setUp(self):
     self.commands = patterns.CommandHistory()
     self.command = patterns.Command()
コード例 #9
0
 def assertHistoryAndFuture(self, expectedHistory, expectedFuture):
     from taskcoachlib import patterns
     commands = patterns.CommandHistory()
     self.assertEqual(expectedHistory, commands.getHistory())
     self.assertEqual(expectedFuture, commands.getFuture())
コード例 #10
0
 def redo(self):
     patterns.CommandHistory().redo()
コード例 #11
0
 def undo(self):
     patterns.CommandHistory().undo()
コード例 #12
0
 def tearDown(self):
     super(CommandTestCase, self).tearDown()
     patterns.CommandHistory().clear()
コード例 #13
0
ファイル: iocontroller.py プロジェクト: dfraser74/taskcoach
 def __closeUnconditionally(self):
     self.__messageCallback(_('Closed %s') % self.__taskFile.filename())
     self.__taskFile.close()
     from taskcoachlib import patterns
     patterns.CommandHistory().clear()