Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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'
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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']
Ejemplo n.º 5
0
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'
Ejemplo n.º 6
0
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