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 ee67efa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions 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
14 changes: 12 additions & 2 deletions tests/test_airdrops.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import json
import os
from jsonschema import validate
import pytest
import requests


def test_airdrops_metadata():
airdrop_index = json.load(open('airdrops/index_v1.json'))
index_schema = json.load(open('tests/airdrop_index_v1_schema.json'))
with open('airdrops/index_v1.json', 'r') as f:
airdrop_index = json.load(f)
with open('tests/airdrop_index_v1_schema.json', 'r') as f:
index_schema = json.load(f)

validate(instance=airdrop_index, schema=index_schema)

# check that the new files exists on their given path
for airdrop in airdrop_index['airdrops'].values():
assert os.path.exists(airdrop['csv_path'])
if 'icon_path' in airdrop:
assert os.path.exists(airdrop['icon_path'])


@pytest.mark.skip('It makes too many requests')
Expand Down

0 comments on commit ee67efa

Please sign in to comment.