コード例 #1
0
def test_update_blocks_top_of_screen():
    ball = Ball(300, 400)
    ball.rect.top = -1
    score = {"p1": 0, "p2": 0}
    ball.update(score)
    assert ball.rect.top == 0
コード例 #2
0
def test_update_blocks_bottom_of_screen():
    ball = Ball(300, 400)
    ball.rect.bottom = 601
    score = {"p1": 0, "p2": 0}
    ball.update(score)
    assert ball.rect.bottom == 600