Skip to content

Commit

Permalink
add main assets for collections
Browse files Browse the repository at this point in the history
  • Loading branch information
prettyirrelevant committed Dec 5, 2024
1 parent 5e6d1cc commit a43a3c2
Show file tree
Hide file tree
Showing 5 changed files with 688 additions and 6 deletions.
9 changes: 7 additions & 2 deletions tests/test_correct_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ def test_asset_collections_updates(version, schema_versions):
root_dir = Path(__file__).parents[1]
upgrade = root_dir / 'updates' / str(version) / 'asset_collections_updates.sql'
# keep this re in sync with the one in the main repo
assets_collection_re = re.compile(r'.*INSERT +INTO +asset_collections\( *id *, *name *, *symbol *\) *VALUES +\(([^,]*?),([^,]*?),([^,]*?)\).*?') # noqa: E501
if version <= 30:
assets_collection_re = re.compile(r'.*INSERT +INTO +asset_collections\( *id *, *name *, *symbol *\) *VALUES +\(([^,]*?),([^,]*?),([^,]*?)\).*?') # noqa: E501
expected_groups = 3
else:
assets_collection_re = re.compile(r'.*INSERT +INTO +asset_collections\( *id *, *name *, *symbol, *main_asset *\) *VALUES +\(([^,]*?),([^,]*?),([^,]*?),([^,]*?)\).*?') # noqa: E501
expected_groups = 4

if upgrade.exists() is False:
return
Expand All @@ -87,7 +92,7 @@ def test_asset_collections_updates(version, schema_versions):
collections_match = assets_collection_re.match(full_insert)
assert collections_match is not None
groups = collections_match.groups()
assert len(groups) == 3
assert len(groups) == expected_groups

lineid = int(groups[0])
assert lineid >= 0
Expand Down
Loading

0 comments on commit a43a3c2

Please sign in to comment.