Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cewei8483 committed Jun 5, 2023
1 parent dff1161 commit ba69dac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion aimmo/game_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def recreate_game_server(
game_data = self.delete_game_server(game_id=game_id)
game_data.update(game_data_updates)

if (game_data.get('settings') and game_data.get('worksheet_id')):
if (game_data.get('settings') and isinstance(game_data.get('settings') , str) and game_data.get('worksheet_id')):
setting = json.loads(game_data['settings'])
setting['TARGET_NUM_PICKUPS_PER_AVATAR'] = 0 if game_data['worksheet_id'] == '1' else 1.2
game_data['settings'] = json.dumps(setting)
Expand Down
4 changes: 2 additions & 2 deletions aimmo/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def expected_game_detail(class_id, worksheet_id):
"era": "1",
"name": "test",
"status": "r",
"settings": '{"GENERATOR": "Main", "OBSTACLE_RATIO": 0.1, "PICKUP_SPAWN_CHANCE": 0.1, "SCORE_DESPAWN_CHANCE": 0.05, "START_HEIGHT": 31, "START_WIDTH": 31, "TARGET_NUM_CELLS_PER_AVATAR": 16.0, "TARGET_NUM_PICKUPS_PER_AVATAR": 1.2, "TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR": 0.5}',
"settings": '{"GENERATOR": "Main", "OBSTACLE_RATIO": 0.1, "PICKUP_SPAWN_CHANCE": 0.1, "SCORE_DESPAWN_CHANCE": 0.05, "START_HEIGHT": 31, "START_WIDTH": 31, "TARGET_NUM_CELLS_PER_AVATAR": 16.0, "TARGET_NUM_PICKUPS_PER_AVATAR": 0.0, "TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR": 0.5}',
"class_id": str(class_id),
"worksheet_id": str(worksheet_id),
}
Expand Down Expand Up @@ -534,7 +534,7 @@ def expected_game_detail(class_id, worksheet_id):
"era": "1",
"name": "test",
"status": "r",
"settings": '{"GENERATOR": "Main", "OBSTACLE_RATIO": 0.1, "PICKUP_SPAWN_CHANCE": 0.1, "SCORE_DESPAWN_CHANCE": 0.05, "START_HEIGHT": 31, "START_WIDTH": 31, "TARGET_NUM_CELLS_PER_AVATAR": 16.0, "TARGET_NUM_PICKUPS_PER_AVATAR": 1.2, "TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR": 0.5}',
"settings": '{"GENERATOR": "Main", "OBSTACLE_RATIO": 0.1, "PICKUP_SPAWN_CHANCE": 0.1, "SCORE_DESPAWN_CHANCE": 0.05, "START_HEIGHT": 31, "START_WIDTH": 31, "TARGET_NUM_CELLS_PER_AVATAR": 16.0, "TARGET_NUM_PICKUPS_PER_AVATAR": 0.0, "TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR": 0.5}',
"class_id": str(class_id),
"worksheet_id": str(worksheet_id),
}
Expand Down

0 comments on commit ba69dac

Please sign in to comment.