def test_add_stone_bad_row(): board1 = SplineState("""\ A C E G 7 . . . . 7 5 . W B . 5 3 . W B . 3 1 . . . . 1 A C E G """) with pytest.raises(ValueError, match='Invalid move: 9C.'): board1.parse_move('9C')
def test_add_stone_third_level(): board1 = SplineState("""\ A C E G 7 . B B W 7 5 . W B W 5 3 . W B B 3 1 . . . . 1 A C E G B D F 6 . W B 6 4 . B W 4 2 . . . 2 B D F """) expected_display = """\ A C E G 7 . B B W 7 5 . W B W 5 3 . W B B 3 1 . . . . 1 A C E G B D F 6 . W B 6 4 . B W 4 2 . . . 2 B D F C E 5 . W 5 3 . . 3 C E """ move = board1.parse_move('5e') board2 = board1.make_move(move) display = board2.display(show_coordinates=True) assert display == expected_display
def test_add_stone_lower_case(): board1 = SplineState() expected_display = """\ A C E G 7 . . . . 7 5 . . . . 5 3 . . B . 3 1 . . . . 1 A C E G """ move = board1.parse_move('3e') board2 = board1.make_move(move) display = board2.display(show_coordinates=True) assert display == expected_display
def test_add_stone_second_level(): board1 = SplineState("""\ A C E G 7 . . . . 7 5 . W B . 5 3 . W B . 3 1 . . . . 1 A C E G """) expected_display = """\ A C E G 7 . . . . 7 5 . W B . 5 3 . W B . 3 1 . . . . 1 A C E G B D F 6 . . . 6 4 . B . 4 2 . . . 2 B D F """ move = board1.parse_move('4D') board2 = board1.make_move(move) display = board2.display(show_coordinates=True) assert display == expected_display