Skip to content

Commit

Permalink
Merge pull request #211 from prettyirrelevant/revert-8b16ad0
Browse files Browse the repository at this point in the history
Revert "Merge pull request #209 from prettyirrelevant/assets-mapping"
  • Loading branch information
yabirgb authored Dec 5, 2024
2 parents 8b16ad0 + 0856a13 commit 5e6d1cc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1,879 deletions.
11 changes: 2 additions & 9 deletions tests/test_correct_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@ def test_asset_collection_mappings(version, schema_versions):
root_dir = Path(__file__).parents[1]
upgrade = root_dir / 'updates' / str(version) / 'asset_collections_mappings_updates.sql'
# keep this re in sync with the one in the main repo
if version > 30:
pattern = '.*(?:INSERT OR REPLACE|INSERT OR IGNORE|INSERT) +INTO +multiasset_mappings\( *collection_id *, *asset *, *is_main_asset *\) *VALUES +\(([^,]*?), *"([^"]+?)" *, *([0-1])\).*?' # noqa: E501
expected_groups = 3
else:
pattern = r'.*INSERT +INTO +multiasset_mappings\( *collection_id *, *asset *\) *VALUES +\(([^,]*?), *"([^,]+?)"\).*?' # noqa: E501
expected_groups = 2

multiasset_mappings_re = re.compile(pattern) # noqa: E501
multiasset_mappings_re = re.compile(r'.*INSERT +INTO +multiasset_mappings\( *collection_id *, *asset *\) *VALUES +\(([^,]*?), *"([^,]+?)"\).*?') # noqa: E501

if upgrade.exists() is False:
return
Expand All @@ -62,7 +55,7 @@ def test_asset_collection_mappings(version, schema_versions):
mappings_match = multiasset_mappings_re.match(line)
assert mappings_match is not None
groups = mappings_match.groups()
assert len(groups) == expected_groups
assert len(groups) == 2

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

0 comments on commit 5e6d1cc

Please sign in to comment.