forked from LiveCarta/ContentAutomation
Implemented content upload app with tests and pre-commit hooks
This commit is contained in:
19
tests/test_settings.py
Normal file
19
tests/test_settings.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from content_automation.settings import AppSettings
|
||||
|
||||
|
||||
def test_settings_parse_nested_env(monkeypatch) -> None:
|
||||
monkeypatch.setenv("CONTENT_AUTOMATION_TARGET_SOCIAL_NETWORKS", '["youtube"]')
|
||||
monkeypatch.setenv("CONTENT_AUTOMATION_YOUTUBE__ACCESS_TOKEN", "yt-token")
|
||||
monkeypatch.setenv("CONTENT_AUTOMATION_YOUTUBE__USE_RESUMABLE_UPLOAD", "true")
|
||||
monkeypatch.setenv("CONTENT_AUTOMATION_STORAGE__BACKEND", "s3")
|
||||
monkeypatch.setenv("CONTENT_AUTOMATION_STORAGE__S3__BUCKET_NAME", "bucket-a")
|
||||
|
||||
settings = AppSettings()
|
||||
|
||||
assert settings.target_social_networks == ["youtube"]
|
||||
assert settings.youtube.access_token == "yt-token"
|
||||
assert settings.youtube.use_resumable_upload is True
|
||||
assert settings.storage.backend == "s3"
|
||||
assert settings.storage.s3.bucket_name == "bucket-a"
|
||||
Reference in New Issue
Block a user