Skip to content

Commit

Permalink
Fix wrong test comments
Browse files Browse the repository at this point in the history
test_player_in_lane_wins() is wrong, not testing any collision. We need
to fix it before we do that fix the comments to describe whats going on
correctly.
  • Loading branch information
nirs committed Aug 27, 2023
1 parent cc7ca12 commit 117d640
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rose/server/score_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,23 @@ def process(self):
score.process(players, self.track)

def test_player_in_lane_wins(self):
# Player 1 in its lane at 1,5
self.track.set(1, 6, obstacles.PENGUIN)
# Player 1 in its lane at 1,5, missed the penguin.
self.player1.x = 1
self.player1.y = 5
self.player1.score = 0
self.player1.action = actions.NONE
# Player 2 is not in its lane, trying to pick penguin at 1,6
self.track.set(1, 6, obstacles.PENGUIN)
# Player 2 is not in its lane, trying to pick up the penguin.
self.player2.x = 1
self.player2.y = 6
self.player2.score = 0
self.player2.action = actions.PICKUP
self.process()
# Player 1 win because it is in lane
# Player got the normal score for this step.
assert self.player1.x == 1
assert self.player1.y == 5
assert self.player1.score == self.player1.score
# Player 2 got more score but move back
assert self.player1.score == config.score_move_forward
# Player 2 picked up the penging, got extra score.
assert self.player2.x == 1
assert self.player2.y == 6
assert self.player2.score == config.score_move_forward * 2
Expand Down

0 comments on commit 117d640

Please sign in to comment.