コード例 #1
0
ファイル: test_info.py プロジェクト: wingkongex/mlbgame
 def test_injury(self):
     injury = mlbgame.injury()
     self.assertIsInstance(injury.injuries, list)
     for player in injury.injuries:
         self.assertIsInstance(player.display_ts, str)
         self.assertIsInstance(player.due_back, (str, int))
         self.assertIsInstance(player.injury_desc, str)
         self.assertIsInstance(player.injury_status, str)
         self.assertIsInstance(player.injury_update, str)
         self.assertIsInstance(player.insert_ts, str)
         self.assertIsInstance(player.league_id, int)
         self.assertIsInstance(player.name_first, str)
         self.assertIsInstance(player.name_last, str)
         self.assertIsInstance(player.player_id, int)
         self.assertIsInstance(player.position, str)
         self.assertIsInstance(player.team_id, int)
         self.assertIsInstance(player.team_name, str)
コード例 #2
0
 def test_injury(self):
     injury = mlbgame.injury()
     self.assertIsInstance(injury.injuries, list)
     for player in injury.injuries:
         self.assertIsInstance(player.display_ts, str)
         self.assertIsInstance(player.due_back, (str, int))
         self.assertIsInstance(player.injury_desc, str)
         self.assertIsInstance(player.injury_status, str)
         self.assertIsInstance(player.injury_update, str)
         self.assertIsInstance(player.insert_ts, str)
         self.assertIsInstance(player.league_id, int)
         self.assertIsInstance(player.name_first, str)
         self.assertIsInstance(player.name_last, str)
         self.assertIsInstance(player.player_id, int)
         self.assertIsInstance(player.position, str)
         self.assertIsInstance(player.team_id, int)
         self.assertIsInstance(player.team_name, str)
     mlbgame.data.INJURY_URL = ''
     self.assertRaises(ValueError, lambda: mlbgame.data.get_injuries())