Skip to content

Commit

Permalink
Merge branch 'issues/268-269-load-map' into issues/268-initial-map-csv
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpm committed Oct 13, 2023
2 parents 927bae7 + 63bf202 commit faa4245
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_griduniverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ def test_handle_connect_adds_player_to_grid(self, exp, a):
exp.handle_connect({"player_id": participant.id})
assert participant.id in exp.grid.players

def test_handle_connect_uses_existing_player_on_grid(self, exp, a):
participant = a.participant()
exp.grid.players[participant.id] = Player(
id=participant.id, color=[0.50, 0.86, 1.00], location=[10, 10]
)
exp.handle_connect({"player_id": participant.id})
assert participant.id in exp.node_by_player_id
assert len(exp.grid.players) == 1
assert len(exp.node_by_player_id) == 1

def test_handle_connect_is_noop_for_spectators(self, exp):
exp.handle_connect({"player_id": "spectator"})
assert exp.node_by_player_id == {}
Expand Down

0 comments on commit faa4245

Please sign in to comment.