Remove dotenv, add util.environment and test of variable load
This commit is contained in:
1 parent
f9400ee92d
commit
16dd4ad287
1 file changed
+8
-3
+8
-3
@@ -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
|
||||
Reference in new issue
Block a user