fix(config): return None if env var is empty or non-existent (#315)
* fix(config): return None if env var is empty or non-existent * chore: fix pylint issues * fix: add unit test for non-existent env vars
This commit is contained in:
@ -8,12 +8,14 @@ from app.utils.datetime import timestamp_to_date # pragma: no cover
|
||||
|
||||
|
||||
def test_correct() -> None:
|
||||
"""Test timestamp_to_date() with a correct timestamp."""
|
||||
timestamp: int = 1680722218
|
||||
result: str = timestamp_to_date(timestamp)
|
||||
assert result == "2023-04-05"
|
||||
|
||||
|
||||
def test_invalid() -> None:
|
||||
"""Test timestamp_to_date() with an invalid timestamp."""
|
||||
timestamp: str = "hello"
|
||||
with pytest.raises(TypeError) as excinfo:
|
||||
timestamp_to_date(timestamp)
|
||||
|
Reference in New Issue
Block a user