aboutsummaryrefslogtreecommitdiff
path: root/test/test_providers.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_providers.py')
-rw-r--r--test/test_providers.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_providers.py b/test/test_providers.py
new file mode 100644
index 0000000..9a5084e
--- /dev/null
+++ b/test/test_providers.py
@@ -0,0 +1,23 @@
+import praw
+import pytest
+
+from importer.downloader import Downloader
+import importer.providers as providers
+from importer.providers import ProviderBase
+
+
+@pytest.mark.parametrize("provider",
+ [
+ providers.IReddit,
+ providers.Imgur,
+ providers.RawImageProviderBase,
+ providers.RedGifs,
+ providers.Youtube,
+ providers.YoutubeDlProviderBase
+ ])
+def test_provider(provider):
+ for test in provider._TEST:
+ with provider(url=test['url']) as p:
+ p.download()
+ assert p.downloaded
+ assert p.paths == test['paths']