Example #1
0
def test_user_game_relation_user():
    """ Test user-game relationship from a user viewpoint. """

    user = users.get("test_user")
    game = games.get("Flingler")
    game2 = games.get("Flingler II")

    user.games.append(game)
    user.games.append(game2)

    assert game in user.games
    assert game2 in user.games
Example #2
0
def test_user_game_relation_user():
    """ Test user-game relationship from a user viewpoint. """

    user = users.get("test_user")
    game = games.get("Flingler")
    game2 = games.get("Flingler II")

    user.games.append(game)
    user.games.append(game2)

    assert game in user.games
    assert game2 in user.games
Example #3
0
def test_calculate_rating_correct():
    """ Test if rating is calculated correctly. """

    game = games.get("Flingler")
    rating = ratings.calculate(game)

    assert 3.0 == rating
Example #4
0
def test_plat_game_relation_plat():
    """ Test platform-game relationship from a platform viewpoint. """

    platform = platforms.get("Android")
    game = games.get("Flingler")

    assert game in platform.games
Example #5
0
def test_plat_game_relation_plat():
    """ Test platform-game relationship from a platform viewpoint. """

    platform = platforms.get("Android")
    game = games.get("Flingler")

    assert game in platform.games
Example #6
0
def test_delete_game():
    """ Test game deleting. """

    game = games.get("Flingler")
    game.delete()

    assert_raises(exceptions.NonExistentGame, games.get, "Flingler")
Example #7
0
def test_calculate_rating_correct():
    """ Test if rating is calculated correctly. """

    game = games.get("Flingler")
    rating = ratings.calculate(game)

    assert 3.0 == rating
Example #8
0
def test_delete_game():
    """ Test game deleting. """

    game = games.get("Flingler")
    game.delete()

    assert_raises(exceptions.NonExistentGame, games.get, "Flingler")
Example #9
0
def test_game_event():
    """ Test event game adding """

    event = events.get(1)
    game = games.get(1)

    event.games.append(game)

    assert game in event.games
Example #10
0
def test_game_event():
    """ Test event game adding """

    event = events.get(1)
    game = games.get(1)

    event.games.append(game)

    assert game in event.games
Example #11
0
def test_plat_game_relation_game():
    """ Test platform-game relationship from a game viewpoint. """

    game = games.get("Flingler")
    platform = platforms.get("Windows")
    platform2 = platforms.get("Android")

    game.platforms.append(platform)
    game.platforms.append(platform2)

    assert platform in game.platforms
    assert platform2 in game.platforms
Example #12
0
def test_plat_game_relation_game():
    """ Test platform-game relationship from a game viewpoint. """

    game = games.get("Flingler")
    platform = platforms.get("Windows")
    platform2 = platforms.get("Android")

    game.platforms.append(platform)
    game.platforms.append(platform2)

    assert platform in game.platforms
    assert platform2 in game.platforms
Example #13
0
def test_game_add_rating():
    """ Test adding ratings to a game. """

    game = games.get("Flingler")

    rating = ratings.get(1)
    rating2 = ratings.get(2)
    rating3 = rating.get(3)

    game.ratings.append(rating)
    game.ratings.append(rating2)
    game.ratings.append(rating3)

    assert rating in game.ratings
    assert rating3 in game.ratings
Example #14
0
def test_game_add_rating():
    """ Test adding ratings to a game. """

    game = games.get("Flingler")

    rating = ratings.get(1)
    rating2 = ratings.get(2)
    rating3 = rating.get(3)

    game.ratings.append(rating)
    game.ratings.append(rating2)
    game.ratings.append(rating3)

    assert rating in game.ratings
    assert rating3 in game.ratings
Example #15
0
def test_user_game_relation_game():
    """ Test user-game relationship from a game viewpoint. """

    game = games.get("Flingler")

    assert game.author.name == "test_user"
Example #16
0
def test_user_game_relation_game():
    """ Test user-game relationship from a game viewpoint. """

    game = games.get("Flingler")

    assert game.author.name == "test_user"
Example #17
0
def test_game_get_correct():
    """ Test game getting. """

    game = games.get("Flingler")
    assert type(game) == models.Game
Example #18
0
def test_game_get_correct():
    """ Test game getting. """

    game = games.get("Flingler")
    assert type(game) == models.Game