aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_resources.py
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2019-09-16 21:37:49 +0200
committerGravatar GitHub <[email protected]>2019-09-16 21:37:49 +0200
commit2b4b0a55f76e1ed63ab6b3f9b6caf76f95c1cccd (patch)
tree07309446427c5f5ed4e88a3b29f5d188c6869dfc /tests/test_resources.py
parentImplement `!otn search`. Closes #408. (diff)
parentUpdate discord.py version to 1.2.3 (#433) (diff)
Merge branch 'master' into otn-search-command
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')