コード例 #1
0
def test_teams2():
    '''Runs all test cases on the input matrix that can be found in teams2.txt.
    '''
    division = Division("teams2.txt")
    for (ID, team) in division.teams.items():
        if team.name == "NewYork" or team.name == "Baltimore" or team.name == "Boston" or team.name == "Toronto":
            assert_not_eliminated(division, team)
        elif team.name == "Detroit":
            assert_eliminated(division, team)
    print("test_teams2 completed")
コード例 #2
0
def test_teams4():
    '''Runs all test cases on the input matrix that was given in the lab
    description. It is stored in teams4.txt.
    '''
    division = Division("teams4.txt")
    for (ID, team) in division.teams.items():
        if team.name == "Prava" or team.name == "Vicky":
            assert_eliminated(division, team)
        elif team.name == "Emily" or team.name == "Shashank":
            assert_not_eliminated(division, team)
    print("test_teams4 completed")
コード例 #3
0
def test_teams7():
    '''Runs all test cases on the input matrix that was given in the lab
    description. It is stored in teams7.txt.
    '''
    division = Division("teams7.txt")
    for (ID, team) in division.teams.items():
        if team.name == "Ireland" or team.name == "China":
            assert_eliminated(division, team)
        elif (team.name == "U.S.A." or team.name == "England" or team.name == "France"
            or team.name == "Germany" or team.name == "Belgium"):
            assert_not_eliminated(division, team)
    print("test_teams7 completed")
コード例 #4
0
def test_teams24():
    '''Runs all test cases on the input matrix that was given in the lab
    description. It is stored in teams24.txt.
    '''
    division = Division("teams24.txt")
    for (ID, team) in division.teams.items():
        if (team.name == "Team4" or team.name == "Team5" or team.name == "Team7"
            or team.name == "Team9" or team.name == "Team11" or team.name == "Team12" or team.name == "Team13"
            or team.name == "Team16" or team.name == "Team19" or team.name == "Team23"):
            assert_eliminated(division, team)
        elif (team.name == "Team0" or team.name == "Team1" or team.name == "Team2"
            or team.name == "Team3" or team.name == "Team6" or team.name == "Team8"
            or team.name == "Team10" or team.name == "Team14"
            or team.name == "Team15" or team.name == "Team16" or team.name == "Team17"
            or team.name == "Team18" or team.name == "Team20" or team.name == "Team21"
            or team.name == "Team22"):
            assert_not_eliminated(division, team)
    print("test_teams24 completed")