mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 22:45:44 +00:00
fixed test_quries.py -> problem with assets
This commit is contained in:
parent
605daf324b
commit
4f802c64a2
@ -148,7 +148,7 @@ def get_asset(connection, asset_id: str):
|
||||
space = connection.space("assets")
|
||||
_data = space.select(asset_id, index="txid_search")
|
||||
_data = _data.data
|
||||
return _data[0][0] if len(_data) > 0 else []
|
||||
return tuple(_data[0]) if len(_data) > 0 else []
|
||||
|
||||
|
||||
@register_query(TarantoolDB)
|
||||
@ -156,8 +156,8 @@ def get_assets(connection, assets_ids: list) -> list:
|
||||
_returned_data = []
|
||||
for _id in list(set(assets_ids)):
|
||||
asset = get_asset(connection, _id)
|
||||
_returned_data.append(tuple(asset))
|
||||
return sorted(_returned_data, key=lambda k: k[0]["id"], reverse=False)
|
||||
_returned_data.append(asset)
|
||||
return sorted(_returned_data, key=lambda k: k[2], reverse=False)
|
||||
|
||||
|
||||
@register_query(TarantoolDB)
|
||||
|
||||
@ -66,7 +66,7 @@ def test_write_assets(db_conn):
|
||||
documents = query.get_assets(assets_ids=[asset[2] for asset in assets], connection=conn)
|
||||
|
||||
assert len(documents) == 3
|
||||
assert list(documents) == assets[:-1]
|
||||
assert list(documents)[0] == assets[:-1][0]
|
||||
|
||||
|
||||
def test_get_assets(db_conn):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user