From a6a9e4ca7c598d4a9856103c65029f4ea82e66a9 Mon Sep 17 00:00:00 2001 From: tdhood Date: Thu, 20 Apr 2023 10:04:17 -0700 Subject: [PATCH] testing added for louisiana --- tests/test_louisiana.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/test_louisiana.py diff --git a/tests/test_louisiana.py b/tests/test_louisiana.py new file mode 100644 index 0000000..240cca7 --- /dev/null +++ b/tests/test_louisiana.py @@ -0,0 +1,21 @@ +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) \ No newline at end of file