aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_resources.py
diff options
context:
space:
mode:
authorGravatar sco1 <[email protected]>2019-09-18 14:00:57 -0700
committerGravatar sco1 <[email protected]>2019-09-18 14:10:06 -0700
commit2ac0c6df978f20a488b3eb026753c8a972cb2554 (patch)
tree43fc70b14b517139dea5324e762ba92a9e211e28 /tests/test_resources.py
parentDocstring linting chunk 7 (diff)
parentMerge pull request #436 from python-discord/enhance-offtopicnames-search (diff)
Merge branch 'master' into flake8-plugins
Diffstat (limited to 'tests/test_resources.py')
-rw-r--r--tests/test_resources.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_resources.py b/tests/test_resources.py
new file mode 100644
index 000000000..2b17aea64
--- /dev/null
+++ b/tests/test_resources.py
@@ -0,0 +1,18 @@
+import json
+import mimetypes
+from pathlib import Path
+from urllib.parse import urlparse
+
+
+def test_stars_valid():
+ """Validates that `bot/resources/stars.json` contains valid images."""
+
+ path = Path('bot', 'resources', 'stars.json')
+ content = path.read_text()
+ data = json.loads(content)
+
+ for url in data.values():
+ assert urlparse(url).scheme == 'https'
+
+ mimetype, _ = mimetypes.guess_type(url)
+ assert mimetype in ('image/jpeg', 'image/png')