Esempio n. 1
0
	def test_game_id_conversion_wrong_input_size(self):
		season = "201211111"
		game_id = "02040000"
		with self.assertRaises(Exception) as context:
			GameList.convert_game_id(season, game_id)
		self.assertEqual(context.exception.message, 
			"game_id is length 10 - should be length 8")
Esempio n. 2
0
	def test_game_id_conversion_season_error_message(self):
		season = "199121444"
		game_id = "020431"
		with self.assertRaises(Exception) as context:
			GameList.convert_game_id(season, game_id)
		self.assertEqual(context.exception.message, 
			"season value is 91 - should be between 12 and 19")
Esempio n. 3
0
	def test_game_id_conversion_game_id_error_message(self):
		season = "20122013"
		game_id = "139299"
		with self.assertRaises(Exception) as context:
			GameList.convert_game_id(season, game_id)
		self.assertEqual(context.exception.message, 
			"game_id starts with 13 - should start with 02 or 03")
Esempio n. 4
0
	def test_good_game_id_conversion(self):
		season = "20122013"
		game_id = "020431"
		self.assertEqual(12020431, GameList.convert_game_id(season, game_id))