Beispiel #1
0
    def checkGames(self):
        # What year are we starting our checks
        startYear = 2012

        # Get Competitions list
        c = Competition()
        c.connectDB()
        competitions = c.loadAll()

        [self.reviewCompetition(record['CompetitionID'], startYear)
         for record
         in competitions]
def test_competition_loadAll():
    c = Competition()
    c.connectDB()

    result = c.loadAll()
    assert isinstance(result, list)
    assert isinstance(result[0], dict)
    assert len(result) == 4
    item = result[0]
    assert item['CompetitionID'] == 3
    assert item['Competition'] == 'MLS Cup'
    assert item['CompetitionType'] == 'Playoffs'
    assert item['Official'] == 1
def test_competition_disconnect():
    c = Competition()
    c.connectDB()
    assert hasattr(c, 'db')
    c.disconnectDB()
    assert hasattr(c, 'db') is False