fix test that game cannot be started twice
This commit is contained in:
		
							parent
							
								
									8c6128d45e
								
							
						
					
					
						commit
						2459d74df0
					
				| @ -205,6 +205,7 @@ def test_that_people_can_start_a_game(): | ||||
| def test_that_a_started_game_cannot_be_started_again(): | ||||
|     owner = User("neosteopathie") | ||||
|     game_id = createGame(owner) | ||||
|     startGame(owner) | ||||
|     with pytest.raises(TestException) as e:  | ||||
|         startGame(owner) | ||||
| 
 | ||||
|  | ||||
| @ -50,7 +50,7 @@ class Game: | ||||
|         self.game_id = None | ||||
|         self.owner = None | ||||
|         self.members = [] | ||||
|         self.has_started = True | ||||
|         self.has_started = False | ||||
| 
 | ||||
|     def set_owner(self, username): | ||||
|         self.owner = Member(username) | ||||
|  | ||||
| @ -59,10 +59,11 @@ def start_game(): | ||||
| 
 | ||||
|     if game == None: | ||||
|         return {"error": 1, "msg": "this game doesn't exist"} | ||||
|     print(game.has_started) | ||||
|     if game.has_started: | ||||
|         return {"error": 1, "msg": "this game is already started"} | ||||
| 
 | ||||
|     game.has_started = None | ||||
|     game.has_started = True | ||||
| 
 | ||||
|      | ||||
|      | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user