From 16dd4ad287dbfaeb7c8820613cab0f5d1fb091a2 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 4 Mar 2026 20:08:28 -0500 Subject: [PATCH] Remove dotenv, add util.environment and test of variable load --- tests/test_util.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_util.py b/tests/test_util.py index cc961db..d2cf0d8 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,16 +1,14 @@ """Tests for the `util` module.""" from datetime import datetime -from dotenv import load_dotenv import pytest import util.convert as uc import util.drawing as ud +import util.environment as ue import util.scrape as sc import util.odds as uo from data.database import PowerballDraw, MegaMillionsDraw -load_dotenv() - def test_convert_string_to_integer() -> None: """Test string value conversion to integer.""" @@ -99,3 +97,10 @@ def test_get_mega_millions_object() -> None: 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 + + +def test_load_environment_variables() -> None: + """test loading environment variables for script use""" + env_vars = ue.load_environment_variables() + assert type(env_vars) == dict + assert len(env_vars) == 23