Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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
Example #4
0
    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
Example #5
0
 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');
Example #6
0
 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'])
Example #7
0
 def test_create(self):
     lotto_obj = models.lotto(self.game, self.num_string, self.draw_date)
     self.assertEqual(lotto_obj.get_game(),'Lotto')
Example #8
0
 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')
Example #9
0
 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'])
Example #10
0
 def test_create(self):
     lotto_obj = models.lotto(self.game, self.num_string, self.draw_date)
     self.assertEqual(lotto_obj.get_game(), 'Lotto')