summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvitiko98 <[email protected]>2022-06-21 16:27:52 -0400
committervitiko98 <[email protected]>2022-06-21 16:27:52 -0400
commitbd8f4027dd3225206e2a4600701878284ea632c0 (patch)
treec1535b743b7685908ec013833e44ecc3d8081722
parent616994487c44d31552409e9f2ebfe676c8934c56 (diff)
downloadbazarr-bd8f4027dd3225206e2a4600701878284ea632c0.tar.gz
bazarr-bd8f4027dd3225206e2a4600701878284ea632c0.zip
no log: add get_providers tests
-rw-r--r--tests/bazarr/app/test_get_providers.py26
1 files changed, 26 insertions, 0 deletions
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