From bd8f4027dd3225206e2a4600701878284ea632c0 Mon Sep 17 00:00:00 2001 From: vitiko98 Date: Tue, 21 Jun 2022 16:27:52 -0400 Subject: no log: add get_providers tests --- tests/bazarr/app/test_get_providers.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/bazarr/app/test_get_providers.py diff --git a/tests/bazarr/app/test_get_providers.py b/tests/bazarr/app/test_get_providers.py new file mode 100644 index 000000000..d4db1c942 --- /dev/null +++ b/tests/bazarr/app/test_get_providers.py @@ -0,0 +1,26 @@ +import pytest + +import inspect + +from bazarr.app import get_providers + + +def test_get_providers_auth(): + for val in get_providers.get_providers_auth().values(): + assert isinstance(val, dict) + + +def test_get_providers_auth_with_provider_registry(): + """Make sure all providers will be properly initialized with bazarr + configs""" + from subliminal_patch.extensions import provider_registry + + auths = get_providers.get_providers_auth() + for key, val in auths.items(): + provider = provider_registry[key] + sign = inspect.signature(provider.__init__) + for sub_key in val.keys(): + if sub_key not in sign.parameters: + raise ValueError(f"'{sub_key}' parameter not present in {provider}") + + assert sign.parameters[sub_key] is not None -- cgit v1.2.3