Esempio n. 1
0
def test_start_display():
    board = SplineState()
    expected_display = """\
  A C E G
7 . . . . 7

5 . . . . 5

3 . . . . 3

1 . . . . 1
  A C E G
"""

    display = board.display(show_coordinates=True)

    assert display == expected_display
Esempio n. 2
0
def test_init_text():
    expected_display = """\
  A C E G
7 . . . . 7

5 . W . . 5

3 . . B . 3

1 . . . . 1
  A C E G
"""
    board = SplineState(text=expected_display)

    display = board.display(show_coordinates=True)

    assert display == expected_display
Esempio n. 3
0
def test_init_text_partial():
    text = """\
Headers ignored
! WxB
garbage
??B W
"""
    expected_display = """\
  A C E G
7 W B . . 7

5 B W . . 5

3 . . . . 3

1 . . . . 1
  A C E G
"""
    board = SplineState(text=text)

    display = board.display(show_coordinates=True)

    assert display == expected_display
Esempio n. 4
0
def test_init_text_second_level():
    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 . R . 4

 2 . . . 2
   B D F
"""
    board = SplineState(text=expected_display)

    display = board.display(show_coordinates=True)

    assert display == expected_display