コード例 #1
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
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
コード例 #2
0
ファイル: test.py プロジェクト: youdonotexist/gjms
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
コード例 #3
0
ファイル: test.py プロジェクト: youdonotexist/gjms
def test_calculate_rating_correct():
    """ Test if rating is calculated correctly. """

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

    assert 3.0 == rating
コード例 #4
0
ファイル: test.py プロジェクト: youdonotexist/gjms
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
コード例 #5
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
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
コード例 #6
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_delete_game():
    """ Test game deleting. """

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

    assert_raises(exceptions.NonExistentGame, games.get, "Flingler")
コード例 #7
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_calculate_rating_correct():
    """ Test if rating is calculated correctly. """

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

    assert 3.0 == rating
コード例 #8
0
ファイル: test.py プロジェクト: youdonotexist/gjms
def test_delete_game():
    """ Test game deleting. """

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

    assert_raises(exceptions.NonExistentGame, games.get, "Flingler")
コード例 #9
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
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
コード例 #10
0
ファイル: test.py プロジェクト: youdonotexist/gjms
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
コード例 #11
0
ファイル: test.py プロジェクト: youdonotexist/gjms
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
コード例 #12
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
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
コード例 #13
0
ファイル: test.py プロジェクト: youdonotexist/gjms
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
コード例 #14
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
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
コード例 #15
0
ファイル: test.py プロジェクト: youdonotexist/gjms
def test_user_game_relation_game():
    """ Test user-game relationship from a game viewpoint. """

    game = games.get("Flingler")

    assert game.author.name == "test_user"
コード例 #16
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_user_game_relation_game():
    """ Test user-game relationship from a game viewpoint. """

    game = games.get("Flingler")

    assert game.author.name == "test_user"
コード例 #17
0
ファイル: test.py プロジェクト: youdonotexist/gjms
def test_game_get_correct():
    """ Test game getting. """

    game = games.get("Flingler")
    assert type(game) == models.Game
コード例 #18
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_game_get_correct():
    """ Test game getting. """

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