fixed test case, added TODO on transaction.py for COMPOSE DECOMPOSE

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger 2022-04-26 14:18:35 +02:00
parent c8a263c6e4
commit f9778e9ba1
No known key found for this signature in database
GPG Key ID: FA5EE906EB55316A

View File

@ -684,13 +684,14 @@ class Transaction(object):
tx_ids.append(tx['id']) tx_ids.append(tx['id'])
# TODO: Find occurences of get_assets and refactor # TODO: Find occurences of get_assets and refactor
# NOTE: Open issue for get_assets and this logic, it won't hold up for COMPOSE/DECOMPOSE
assets = list(planet.get_assets(tx_ids)) assets = list(planet.get_assets(tx_ids))
for asset in assets: for asset in assets:
if asset is not None: if asset is not None:
if tx_map.get(asset.get('id', None), None) is not None: if tx_map.get(asset.get('id', None), None) is not None:
tx = tx_map[asset['id']] tx = tx_map[asset['id']]
del asset['id'] del asset['id']
tx['asset'] = asset tx['assets'] = [asset]
tx_ids = list(tx_map.keys()) tx_ids = list(tx_map.keys())
metadata_list = list(planet.get_metadata(tx_ids)) metadata_list = list(planet.get_metadata(tx_ids))