added working validate_config for Match module

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

Former-commit-id: b9e2de2dc6
This commit is contained in:
Arthur Lu 2021-10-21 20:28:29 +00:00
parent 36081e1239
commit 07965cba4b

View File

@ -32,7 +32,18 @@ class Match:
self.teams = teams self.teams = teams
def validate_config(self): def validate_config(self):
return True if self.config == None:
return "config cannot be empty"
elif self.apikey == None or self.apikey == "":
return "apikey cannot be empty"
elif self.tbakey == None or self.tbakey == "":
return "tbakey cannot be empty"
elif not(self.config["scope"] in ["competition", "season", "none"]):
return "scope must be one of: (competition, season, none)"
elif not(self.config["agglomeration"] in ["none", "mean"]):
return "agglomeration must be one of: (none, mean)"
else:
return None
def load_data(self): def load_data(self):
pass pass