def testIsMatchCompletePlayed(self): xml = """ <match> <playedMatch> <teamInMatch> <battingFirst>true</battingFirst> <innings> <runsScored>140</runsScored> <wicketsLost>6</wicketsLost> </innings> </teamInMatch> <teamInMatch> <battingFirst>false</battingFirst> <innings> <runsScored>141</runsScored> <wicketsLost>4</wicketsLost> <ballsBowled>60</ballsBowled> </innings> </teamInMatch> </playedMatch> </match> """ matchElement = ElementTree.fromstring(xml) generator = LeagueFixturesReportGenerator() result = generator.isMatchComplete(matchElement) expectedResult = True self.assertEqual(expectedResult, result)
def testIsMatchCompleteNotPlayedOrAwarded(self): xml = """ <match> </match> """ matchElement = ElementTree.fromstring(xml) generator = LeagueFixturesReportGenerator() result = generator.isMatchComplete(matchElement) expectedResult = False self.assertEqual(expectedResult, result)