Add test for mega millions object
This commit is contained in:
1 parent
dca8a4244e
commit
823a3ca4e9
1 file changed
+11
-3
+11
-3
@@ -7,7 +7,7 @@ import util.convert as uc
|
||||
import util.drawing as ud
|
||||
import util.scrape as sc
|
||||
import util.odds as uo
|
||||
from data.database import PowerballDraw
|
||||
from data.database import PowerballDraw, MegaMillionsDraw
|
||||
|
||||
load_dotenv()
|
||||
|
||||
@@ -87,7 +87,15 @@ def test_get_odds_of_winning() -> None:
|
||||
|
||||
def test_get_powerball_object() -> None:
|
||||
data_value = ud.get_powerball_object(draw_date='2026-01-03', draw_result={'main_balls': [18, 21, 40, 53, 60],
|
||||
'powerball': 23, 'multiplier': 3})
|
||||
'powerball': 23, 'multiplier': 3})
|
||||
test_record = PowerballDraw(draw_date=datetime(2026, 1, 3).date(), main_ball1=18, main_ball2=21,
|
||||
main_ball3=40, main_ball4=53, main_ball5=60, powerball=23, power_play=3)
|
||||
main_ball3=40, main_ball4=53, main_ball5=60, powerball=23, power_play=3)
|
||||
assert data_value == test_record
|
||||
|
||||
|
||||
def test_get_mega_millions_object() -> None:
|
||||
data_value = ud.get_mega_millions_object(draw_date='2010-02-02', draw_result={'main_balls': [6, 7, 26, 27, 49],
|
||||
'mega-ball': 9, 'multiplier': 4})
|
||||
test_record = MegaMillionsDraw(draw_date=datetime(2010, 2, 2).date(), main_ball1=6, main_ball2=7,
|
||||
main_ball3=26, main_ball4=27, main_ball5=49, mega_ball=9, megaplier=4)
|
||||
assert data_value == test_record
|
||||
Reference in new issue
Block a user