Beispiel #1
0
def test_team_add_players():

    test_team = AUDLclasses.Team(None, 224002, "Radicals", "Madison")
    test_team.add_players("test_players.json")

    assert type(test_team.Players) is dict
    assert 0 != len(test_team.Players)
Beispiel #2
0
def test_team_add_games():

    test_team = AUDLclasses.Team(None, 224002, "Radicals", "Madison")
    test_team.add_games()

    assert type(test_team.Games) is dict
    assert 15 == len(test_team.Games)
Beispiel #3
0
def test_team_attrs():

    test_team = AUDLclasses.Team(None, 224002, "Radicals", "Madison")
    test_team.populate_team_stats()

    assert type(test_team.ID) is int

    assert type(test_team.Streak) is str

    assert type(test_team.Top_Fives) is list
Beispiel #4
0
def test_team_record_method():

    test_team = team_record_setup()

    test_record = test_team.record()

    assert tuple is type(test_record), type(test_record)
    assert 3 == len(test_record), len(test_record)
    assert 3 == test_record[0], test_record[0]
    assert 2 == test_record[1], test_record[1]
    assert 1 == test_record[2], test_record[2]

    # Test a team without games
    test_team = AUDLclasses.Team(None, 206002, "Breeze", "DC")

    test_record = test_team.record()

    assert None == test_record, test_record
Beispiel #5
0
def team_record_setup():

    test_team = AUDLclasses.Team(None, 224002, "Radicals", "Madison")
    test_team.Games = {}

    test_team.Games['4/10/13'] = AUDLclasses.Game('4/10/13', "7:00 EST",
                                                  "2013", "Madison Radicals",
                                                  "Minnesota Wind Chill")
    test_team.Games['4/10/13'].home_score = 23
    test_team.Games['4/10/13'].away_score = 22

    test_team.Games['4/17/13'] = AUDLclasses.Game('4/17/13', "7:00 EST",
                                                  "2013", "Madison Radicals",
                                                  "Minnesota Wind Chill")
    test_team.Games['4/17/13'].home_score = 23
    test_team.Games['4/17/13'].away_score = 22

    test_team.Games['4/24/13'] = AUDLclasses.Game('4/24/13', "7:00 EST",
                                                  "2013", "Madison Radicals",
                                                  "Minnesota Wind Chill")
    test_team.Games['4/24/13'].home_score = 23
    test_team.Games['4/24/13'].away_score = 25

    test_team.Games['5/1/13'] = AUDLclasses.Game('5/1/13', "7:00 EST", "2013",
                                                 "Madison Radicals",
                                                 "Minnesota Wind Chill")
    test_team.Games['5/1/13'].home_score = 23
    test_team.Games['5/1/13'].away_score = 25

    test_team.Games['5/8/13'] = AUDLclasses.Game('5/8/13', "7:00 EST", "2013",
                                                 "Madison Radicals",
                                                 "Minnesota Wind Chill")
    test_team.Games['5/8/13'].home_score = 28
    test_team.Games['5/8/13'].away_score = 25

    return test_team
Beispiel #6
0
def test_team_methods():

    test_team = AUDLclasses.Team(None, 224002, "Radicals", "Madison")
    test_team.add_players()
    test_team.populate_team_stats()
    assert type(test_team.top_five('Assists')) is list