You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
import os
|
|
import pytest
|
|
from src.config import get_env_tags
|
|
from src.enums import ResponseStatus
|
|
|
|
def test_get_env_tags_basic():
|
|
"""Test get_env_tags with basic key:env mapping."""
|
|
os.environ["UNIT_TEST_ENV_VAR"] = "test_value"
|
|
tag_list = ["my_tag:UNIT_TEST_ENV_VAR"]
|
|
result = get_env_tags(tag_list)
|
|
assert result == {"my_tag": "test_value"}
|
|
|
|
def test_get_env_tags_missing():
|
|
"""Test get_env_tags with missing environment variables."""
|
|
tag_list = ["missing_tag:NON_EXISTENT_VAR_12345"]
|
|
result = get_env_tags(tag_list)
|
|
assert result == {}
|
|
|
|
def test_get_env_tags_multiple():
|
|
"""Test get_env_tags with multiple mappings."""
|
|
os.environ["VAR1"] = "val1"
|
|
os.environ["VAR2"] = "val2"
|
|
tag_list = ["tag1:VAR1", "tag2:VAR2", "tag3:VAR3"]
|
|
result = get_env_tags(tag_list)
|
|
assert result == {"tag1": "val1", "tag2": "val2"}
|
|
|
|
def test_response_status_enum():
|
|
"""Test ResponseStatus enum values."""
|
|
assert ResponseStatus.SUCCESS == "success"
|
|
assert ResponseStatus.ERROR == "error"
|
|
|
|
def test_always_passes():
|
|
"""A dummy test that always passes to show progress."""
|
|
assert True
|
|
|
|
@pytest.mark.parametrize("i", range(10))
|
|
def test_many_tests(i):
|
|
"""Multiple tests to demonstrate progress percentage."""
|
|
assert i >= 0
|