Пример #1
0
    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)])
Пример #2
0
    def test_movement(self):
        model = Model(squares, dictionary_path=dictionary_path)
        model.focus = (2, 2)

        model.move_up()
        self.assertEqual(model.focus, (1, 2))

        model.move_left()
        self.assertEqual(model.focus, (1, 1))

        model.move_down()
        self.assertEqual(model.focus, (2, 1))

        model.move_right()
        self.assertEqual(model.focus, (2, 2))
Пример #3
0
 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)