def test_get_draw_date(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) # Ensure that draw_date is a date object self.assertEqual(lotto_obj.get_draw_date().year,2013) self.assertEqual(lotto_obj.get_draw_date().month,4) self.assertEqual(lotto_obj.get_draw_date().day,15)
def test_get_draw_date(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) # Ensure that draw_date is a date object self.assertEqual(lotto_obj.get_draw_date().year, 2013) self.assertEqual(lotto_obj.get_draw_date().month, 4) self.assertEqual(lotto_obj.get_draw_date().day, 15)
def retrieve_lotto(self): results = '' lotto_results = [] if (self._is_database_available()): results = self.retrieve_from_db() else: results = self.retrieve_from_web_recent() # Pull results only relevant to game type for result in results: if (result['col2'] == self._lotto_game): lotto_obj = models.lotto(self._lotto_game, result['col3'][0], result['col1']) lotto_results.append(lotto_obj) # Pull results that are only releveant to the game type return lotto_results
def test_get_extra_shot(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) self.assertEqual(lotto_obj.get_extra_shot(),'06');
def test_get_numbers(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) self.assertEqual(lotto_obj.get_numbers(),['02','04','08','20','21','47'])
def test_create(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) self.assertEqual(lotto_obj.get_game(),'Lotto')
def test_get_extra_shot(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) self.assertEqual(lotto_obj.get_extra_shot(), '06')
def test_get_numbers(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) self.assertEqual(lotto_obj.get_numbers(), ['02', '04', '08', '20', '21', '47'])
def test_create(self): lotto_obj = models.lotto(self.game, self.num_string, self.draw_date) self.assertEqual(lotto_obj.get_game(), 'Lotto')