Beispiel #1
0
def test_hit():
    b = Board()
    b.add_counter(5, 5)

    assert b.potshot(5, 5) == Board.HIT
    assert b.defeated()
    b.display()
Beispiel #2
0
def test_board():
    b = Board()
    b.add_counter(0, 0)
    b.add_counter(9, 9)

    b.display()

    assert not b.defeated()
Beispiel #3
0
def test_near_miss():
    b = Board()
    b.add_counter(3, 3)

    assert Board.NEAR == b.potshot(2, 2)
    assert not b.defeated()
Beispiel #4
0
def test_miss():
    b = Board()
    b.add_counter(3, 3)

    assert Board.MISS == b.potshot(1, 2)
    assert not b.defeated()