aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-04-27 16:13:47 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2022-04-27 16:13:47 +0200
commit6df21d6a9f08deb4dab96fb17f3540ebfbc8b8fe (patch)
tree9084e4867d81d2af5faaabe0f3440bd1471994c6 /tests
parentc4e0d1efa1ec655bae9134b95a0fcd060cc7bbea (diff)
parentc5982e52d57ceba420d70f1d8d9d10197f4c7d61 (diff)
Merge branch 'master' into xml
Diffstat (limited to 'tests')
-rw-r--r--tests/core/download_assets.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/core/download_assets.py b/tests/core/download_assets.py
index d86f7f1e7..50137f563 100644
--- a/tests/core/download_assets.py
+++ b/tests/core/download_assets.py
@@ -5,8 +5,9 @@ import sys
import os
import zipfile
+TEST_SUITES = ['PNG', 'XML']
DOWNLOAD_BASE_PATH = "assets/{}"
-ASSETS_BASE_URL = "https://raw.githubusercontent.com/Kelimion/compress-odin/master/tests/assets/{}/{}"
+ASSETS_BASE_URL = "https://raw.githubusercontent.com/odin-lang/test-assets/master/{}/{}"
PNG_IMAGES = [
"basi0g01.png", "basi0g02.png", "basi0g04.png", "basi0g08.png", "basi0g16.png", "basi2c08.png",
"basi2c16.png", "basi3p01.png", "basi3p02.png", "basi3p04.png", "basi3p08.png", "basi4a08.png",
@@ -73,25 +74,27 @@ def try_download_and_unpack_zip(suite):
print("Could not extract ZIP file")
return 2
-
def main():
- print("Downloading PNG assets")
+ for suite in TEST_SUITES:
+ print("Downloading {} assets".format(suite))
- # Make PNG assets path
- try:
- path = DOWNLOAD_BASE_PATH.format("PNG")
- os.makedirs(path)
- except FileExistsError:
- pass
+ # Make assets path
+ try:
+ path = DOWNLOAD_BASE_PATH.format(suite)
+ os.makedirs(path)
+ except FileExistsError:
+ pass
+
+ # Try downloading and unpacking the assets
+ r = try_download_and_unpack_zip(suite)
+ if r is not None:
+ return r
+
+ # We could fall back on downloading the PNG files individually, but it's slow
+ print("Done downloading {} assets.".format(suite))
- # Try downloading and unpacking the PNG assets
- r = try_download_and_unpack_zip("PNG")
- if r is not None:
- return r
- # We could fall back on downloading the PNG files individually, but it's slow
- print("Done downloading PNG assets")
return 0
if __name__ == '__main__':