-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
fa27040
commit 8a52cbe
Showing
2 changed files
with
2 additions
and
60 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 |
---|---|---|
@@ -1,62 +1,5 @@ | ||
from typing import Any, Dict | ||
|
||
import pytest | ||
|
||
from reworkd_platform.settings import Settings | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"settings, expected", | ||
[ | ||
( | ||
{ | ||
"pusher_app_id": "123", | ||
"pusher_key": "123", | ||
"pusher_secret": "123", | ||
"pusher_cluster": "123", | ||
}, | ||
True, | ||
), | ||
( | ||
{ | ||
"pusher_app_id": "123", | ||
"pusher_cluster": "123", | ||
}, | ||
False, | ||
), | ||
({}, False), | ||
], | ||
) | ||
def test_pusher_enabled(settings: Dict[str, Any], expected: bool): | ||
settings = Settings(**settings) | ||
assert settings.pusher_enabled == expected | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"settings, expected", | ||
[ | ||
( | ||
{ | ||
"kafka_bootstrap_servers": ["123"], | ||
"kafka_username": "123", | ||
"kafka_password": "123", | ||
}, | ||
True, | ||
), | ||
( | ||
{ | ||
"kafka_bootstrap_servers": ["123"], | ||
"kafka_username": "123", | ||
}, | ||
False, | ||
), | ||
({}, False), | ||
], | ||
) | ||
def test_kafka_enabled(settings: Dict[str, Any], expected: bool): | ||
settings = Settings(**settings) | ||
assert settings.kafka_enabled == expected | ||
|
||
|
||
def test_settings_create(): | ||
assert Settings() is not None |