Пример #1
0
 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)
Пример #2
0
 def test_json(self):
     serialyser = JsonSerialyser()
     service = MatchFactory()
     m = service.getAllMatches()
     serialyser.saveMatches(m)
Пример #3
0
 def test_add_match(self):
     matches = MatchFactory().get_all()
     self.assertIsNone(MatchesService().add_match(matches, 'Lester',
                                                  'Everton', 2, 0, 26, 2,
                                                  2016))
Пример #4
0
 def test_get_team(self):
     matches = MatchFactory().get_all()
     self.assertIsNotNone(MatchesService().get_team(matches, "MU"))
Пример #5
0
 def test_teamPrint(self):
     matches = MatchFactory().get_all()
     self.assertTrue(matches[0] == matches[0])
     self.assertFalse(matches[0] == matches[1])
Пример #6
0
 def test_json(self):
     serialyser = JsonSerialyser()
     service = MatchFactory()
     m = service.get_all()
     serialyser.save_matches(m)
Пример #7
0
 def __init__(self):
     self.view = ConsoleView()
     self.factory = MatchFactory()
     self.service = MatchesService