Ejemplo n.º 1
0
    def test_board_neigbours(self):
        with mock.patch('random.choice',
                        side_effect=[O2, H2, O, Na, Cl, H2, O, Na, H2]):
            board = Board([], 0)
            board.generate(3, (H2, O, Na))
            assert board.neighbours(I(1, 1), I(0, 1)) is True
            assert board.neighbours(I(1, 0), I(1, 1)) is True
            assert board.neighbours(I(1, 1), I(2, 1)) is True
            assert board.neighbours(I(1, 2), I(1, 1)) is True

            assert board.neighbours(I(1, 0), I(0, 1)) is False
            assert board.neighbours(I(0, 1), I(0, 1)) is False