def test_yaml_serialise(self): YamlSerialyser().save_matches(MatchFactory().get_all()) strIO = get_string_from_serialyser("matches.yaml") strIO.seek(0) with open("matches.yaml", "rt") as f: for line in f: self.assertEqual(strIO.readline(), line)
def test_json(self): serialyser = JsonSerialyser() service = MatchFactory() m = service.getAllMatches() serialyser.saveMatches(m)
def test_add_match(self): matches = MatchFactory().get_all() self.assertIsNone(MatchesService().add_match(matches, 'Lester', 'Everton', 2, 0, 26, 2, 2016))
def test_get_team(self): matches = MatchFactory().get_all() self.assertIsNotNone(MatchesService().get_team(matches, "MU"))
def test_teamPrint(self): matches = MatchFactory().get_all() self.assertTrue(matches[0] == matches[0]) self.assertFalse(matches[0] == matches[1])
def test_json(self): serialyser = JsonSerialyser() service = MatchFactory() m = service.get_all() serialyser.save_matches(m)
def __init__(self): self.view = ConsoleView() self.factory = MatchFactory() self.service = MatchesService