def test_get_game_achievements(): """ Test retrieving achievements for a game """ morepath.scan(falchion) morepath.commit(falchion.App()) api_client = Client(falchion.App()) response = api_client.get('/games/10') assert response.status_code == 200 assert len(response.json['achievements']) == 2
def test_get_game_status(): """ Test retrieving status for a game """ morepath.scan(falchion) morepath.commit(falchion.App()) api_client = Client(falchion.App()) response = api_client.get('/games/2') assert response.status_code == 200 assert response.json['status'] == 'unfinished'
def test_get_game_achievement_counts(): """ Test retrieving achievement counts for a game """ morepath.scan(falchion) morepath.commit(falchion.App()) api_client = Client(falchion.App()) response = api_client.get('/games/10') assert response.status_code == 200 assert response.json['achievements']['completed'] == 500 assert response.json['achievements']['total'] == 1200
def test_get_game_tags(): """ Test retrieving tags for a game """ morepath.scan(falchion) morepath.commit(falchion.App) api_client = Client(falchion.App()) response = api_client.get('/games/10') assert response.status_code == 200 assert 'jrpg' in response.json['tags']
def test_get_game_by_id(): """ Test getting a single game by ID """ morepath.scan(falchion) morepath.commit(falchion.App) api_client = Client(falchion.App()) response = api_client.get('/games/1') assert response.status_code == 200 assert response.json['name'] == 'Shovel Knight'
def test_get_games(): """ Test getting a collection of games """ morepath.scan(falchion) morepath.commit(falchion.App) api_client = Client(falchion.App()) response = api_client.get('/games') assert response.status_code == 200 assert len(response.json['games']) == 14