def test_toggle(self): model = Model(squares, dictionary_path=dictionary_path) model.mode = grid.Mode.ACROSS model.focus = (3, 1) model.toggle_orientation() self.assertEqual(model.mode, grid.Mode.DOWN) self.assertEqual(model.highlight, [(3, 1), (4, 1)])
def test_get_next_focus(self, current_focus, text, mode, new_focus): model = Model(squares, dictionary_path=dictionary_path) model.mode = mode model.focus = current_focus model.get_next_focus(text) self.assertEqual(model.focus, new_focus)
def test_update_highlighted_squares(self, focus, mode, highlight): model = Model(squares, dictionary_path=dictionary_path) model.mode = mode model.update_focus(focus[0], focus[1]) self.assertEqual(model.focus, focus) self.assertEqual(model.highlight, highlight)