Пример #1
0
def test_upper_rows(start: int, end: int, expected_valid: bool, reason: str):
    board = SpireState("""\
  A C E G
7 W W R W 7

5 B B R B 5

3 . . . . 3

1 . . . . 1
  A C E G
>B,R
""")
    valid_moves = board.get_valid_moves()
    for move in range(start, end):
        assert valid_moves[move] == expected_valid, move
Пример #2
0
def test_lower_rows(start: int, end: int, expected_valid: bool, reason: str):
    board = SpireState("""\
  A C E G
7 . . . . 7

5 . . . . 5

3 B B R B 3

1 W W R W 1
  A C E G
>B,R
""")
    valid_moves = board.get_valid_moves()
    for move in range(start, end):
        assert valid_moves[move] == expected_valid, move
Пример #3
0
def test_higher_level(start: int, end: int, expected_valid: bool, reason: str):
    board = SpireState("""\
  A C E G
7 B W B R 7

5 W R R W 5

3 B W B R 3

1 W R R W 1
  A C E G
   B D F
 6 . . . 6

 4 . . . 4

 2 B B R 2
   B D F
>B,R
""")
    valid_moves = board.get_valid_moves()
    for move in range(start, end):
        assert valid_moves[move] == expected_valid, move