Esempio n. 1
0
 def __init__(self, data, parent):
     super().__init__(data, parent)
     self.teams = {team['id']: Team(team) for team in data.get('teams', {})}
     self.subleagues = {
         sl['id']: Subleague(sl)
         for sl in data.get('subleagues', {})
     }
     self.divisions = {
         d['id']: Division(d)
         for d in data.get('divisions', {})
     }
     self.leagues = {l['id']: League(l) for l in data.get('leagues', {})}
Esempio n. 2
0
 def subleague_good(self):
     return Subleague.load("7d3a3dd6-9ea1-4535-9d91-bde875c85e80")
Esempio n. 3
0
 def subleague_wild(self):
     return Subleague.load("aabc11a1-81af-4036-9f18-229c759ca8a9")
Esempio n. 4
0
 def subleague_mild(self):
     return Subleague.load("4fe65afa-804f-4bb2-9b15-1281b2eab110")
Esempio n. 5
0
 def test_load_bad_id(self):
     with pytest.raises(ValueError):
         bad_id = Subleague.load("00000000-0000-0000-0000-000000000000")
Esempio n. 6
0
 def test_load(self):
     subleague = Subleague.load("7d3a3dd6-9ea1-4535-9d91-bde875c85e80")
     assert isinstance(subleague, Subleague)