コード例 #1
0
    def test_clear_end(self):
        history = UndoHistory()
        self._populate_history(history)

        with self.assertTraitDoesNotChange(history, 'redoable'):
            with self.assertTraitChanges(history, 'undoable', count=1):
                with self.assertTraitDoesNotChange(self._example, 'anytrait'):
                    history.clear()

        self.assertEqual(history.now, 0)
        self.assertFalse(history.can_undo)
        self.assertFalse(history.can_redo)