From a6a9e4ca7c598d4a9856103c65029f4ea82e66a9 Mon Sep 17 00:00:00 2001 From: tdhood Date: Thu, 20 Apr 2023 10:04:17 -0700 Subject: [PATCH 1/2] 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 From 0f6cebbf7abff5808b87a1a941e65dc5315b6737 Mon Sep 17 00:00:00 2001 From: tdhood Date: Thu, 20 Apr 2023 20:43:58 -0700 Subject: [PATCH 2/2] added new line --- tests/test_louisiana.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_louisiana.py b/tests/test_louisiana.py index 240cca7..62244e3 100644 --- a/tests/test_louisiana.py +++ b/tests/test_louisiana.py @@ -18,4 +18,5 @@ class TestLouisiana(unittest.TestCase): ) 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 + self.assertEqual(game["prizes"][0]["value"], 200000.0) + \ No newline at end of file