From 173aed89cccd2586a3e7567399ed4ddf959b90ed Mon Sep 17 00:00:00 2001 From: tdhood Date: Thu, 20 Apr 2023 21:54:16 -0700 Subject: [PATCH 1/3] added texas testing --- tests/test_texas.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/test_texas.py diff --git a/tests/test_texas.py b/tests/test_texas.py new file mode 100644 index 0000000..e27e346 --- /dev/null +++ b/tests/test_texas.py @@ -0,0 +1,22 @@ +import unittest +import requests + +from lottery_data_scraper import texas +from lottery_data_scraper import schemas + +class TestTexas(unittest.TestCase): + def test_parse_game_html(self): + # URL chosen arbitrarily + url = "http://www.txlottery.org/export/sites/lottery/Games/Scratch_Offs/details.html_252701533.html" + html = texas.fetch_html(url) + game = texas._parse_game(url, html) + self.assertEqual(game['name'], "$1,000,000 Cash Blowout") + self.assertEqual(game["price"], 20.0) + self.assertEqual( + game["url"], + 'http://www.txlottery.org/export/sites/lottery/Games/Scratch_Offs/details.html_252701533.html' , + ) + self.assertEqual(game["game_id"], "2442") + self.assertEqual(game["prizes"][0]["prize"], "$1,000,000") + self.assertEqual(game["prizes"][0]["value"], 1000000.0) + \ No newline at end of file From 6238064f258168cad1ad774c36ededa4759e5fe2 Mon Sep 17 00:00:00 2001 From: tdhood Date: Fri, 21 Apr 2023 14:01:18 -0700 Subject: [PATCH 2/3] added new line --- tests/test_texas.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_texas.py b/tests/test_texas.py index e27e346..05eb30e 100644 --- a/tests/test_texas.py +++ b/tests/test_texas.py @@ -19,4 +19,3 @@ class TestTexas(unittest.TestCase): self.assertEqual(game["game_id"], "2442") self.assertEqual(game["prizes"][0]["prize"], "$1,000,000") self.assertEqual(game["prizes"][0]["value"], 1000000.0) - \ No newline at end of file From 1a06c4cc6da48cdd9c0741bef24ec16526f1030e Mon Sep 17 00:00:00 2001 From: tdhood Date: Fri, 21 Apr 2023 14:03:47 -0700 Subject: [PATCH 3/3] added new line --- tests/test_texas.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_texas.py b/tests/test_texas.py index 05eb30e..a05e750 100644 --- a/tests/test_texas.py +++ b/tests/test_texas.py @@ -19,3 +19,4 @@ class TestTexas(unittest.TestCase): self.assertEqual(game["game_id"], "2442") self.assertEqual(game["prizes"][0]["prize"], "$1,000,000") self.assertEqual(game["prizes"][0]["value"], 1000000.0) +