Skip to content

Commit

Permalink
Fix (Airdrops): Optional icon_path
Browse files Browse the repository at this point in the history
Signed-off-by: OjusWiZard <[email protected]>
  • Loading branch information
OjusWiZard committed Feb 14, 2024
1 parent 3e30ab4 commit 163d002
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/airdrop_index_v1_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"icon": {
"type": "string"
},
"icon_path": {
"type": "string"
},
"cutoff_time": {
"type": "integer"
},
Expand Down Expand Up @@ -131,7 +134,6 @@
"required": [
"asset_identifier",
"csv_path",
"icon",
"name",
"url"
]
Expand Down
11 changes: 11 additions & 0 deletions tests/test_airdrops.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
from jsonschema import validate
import pytest
import requests
Expand Down Expand Up @@ -62,3 +63,13 @@ def test_data_migration():
assert airdrop_name in new_index['poap_airdrops']
with open(new_index['poap_airdrops'][airdrop_name][0], 'r') as f:
assert requests.get(airdrop_url).text.strip() == f.read().strip()


def test_new_files_exists():
with open('airdrops/index_v1.json', 'r') as f:
index = json.load(f)

for airdrop in index['airdrops'].values():
assert os.path.exists(airdrop['csv_path'])
if 'icon_path' in airdrop:
assert os.path.exists(airdrop['icon_path'])

0 comments on commit 163d002

Please sign in to comment.