-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e1b6f8
commit 52e04f8
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
from config import Settings | ||
|
||
|
||
def test_jwt_opts_valid_values(): | ||
mock_config = { | ||
"jwt_opts_test1": "true", | ||
"jwt_opts_test2": "true", | ||
"jwt_opts_test3": "12", | ||
} | ||
settings = Settings(**mock_config) | ||
assert settings.jwt_opts == {"test1": True, "test2": True, "test3": 12} | ||
|
||
|
||
def test_jwt_opts_invalid_values(): | ||
mock_config = { | ||
"jwt_opts_test1": "not a bool or int", | ||
"jwt_opts_test2": "true", | ||
"jwt_opts_test3": "12", | ||
} | ||
with pytest.raises(Exception) as e: | ||
settings = Settings(**mock_config) | ||
assert "validation error" in str(e.value) |