Merge branch '6-add-louisiana-testing'

louisiana testing added
main
Taylor Hood 2 years ago
commit 4a3fa868e2

@ -0,0 +1,22 @@
import unittest
import requests
from lottery_data_scraper import louisiana
from lottery_data_scraper import schemas
class TestLouisiana(unittest.TestCase):
def test_parse_game_html(self):
# URL chosen arbitrarily
url = 'https://louisianalottery.com/scratch-offs/1450/blazing-suits'
html = louisiana.fetch_html(url)
game = louisiana.parse_game(url, html)
self.assertEqual(game['name'], 'Blazing Suits')
self.assertEqual(game["price"], 10.0)
self.assertEqual(
game["url"],
'https://louisianalottery.com/scratch-offs/1450/blazing-suits' ,
)
self.assertEqual(game["game_id"], "1450")
self.assertEqual(game["prizes"][0]["prize"], "$200,000")
self.assertEqual(game["prizes"][0]["value"], 200000.0)
Loading…
Cancel
Save