Skip to content

Commit

Permalink
Fix - Correções e Testes atualizados
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-russo committed Aug 23, 2023
1 parent 890f3b6 commit 33dbbf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/cbers4asat/cbers4asat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from os.path import isdir, join
from os import getcwd, cpu_count, mkdir
from geopandas import GeoDataFrame
from pandas import json_normalize
from shapely.geometry import Polygon


Expand Down Expand Up @@ -265,7 +264,9 @@ def to_geodataframe(products: Dict, crs: str = "EPSG:4326"):
item_metadata.update(bbox=item.bbox)
item_metadata.update(collection=item.collection)
item_metadata.update(thumbnail=item.thumbnail)
item_metadata.update(urls=[{asset: item.url(asset)} for asset in item.assets])
item_metadata.update(
urls=[{asset: item.url(asset)} for asset in item.assets]
)

for index, feature in enumerate(products.get("features")):
if feature["id"] == item.id:
Expand Down
9 changes: 6 additions & 3 deletions tests/test_Cbers4aAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def json():
},
"bbox": [-48.3106, -16.4178, -47.2492, -15.3637],
"properties": {"x": "XYZ"},
"assets": {"blue": {"href": "http://test.dev/image.tif"}},
"assets": {"blue": {"href": "http://test.dev/image.tif"},
"thumbnail": {"href": "http://test.dev/thumbnail.png"}},
"links": [{"x": "y"}],
}
],
Expand Down Expand Up @@ -77,7 +78,8 @@ def json():
},
"bbox": [-48.3106, -16.4178, -47.2492, -15.3637],
"properties": {"x": "XYZ"},
"assets": {"blue": {"href": "http://test.dev/image.tif"}},
"assets": {"blue": {"href": "http://test.dev/image.tif"},
"thumbnail": {"href": "http://test.dev/thumbnail.png"}},
"links": [{"x": "y"}],
}

Expand Down Expand Up @@ -105,7 +107,8 @@ class TestCbers4aAPI:
},
"bbox": [-48.3106, -16.4178, -47.2492, -15.3637],
"properties": {"x": "XYZ"},
"assets": {"blue": {"href": "http://test.dev/image.tif"}},
"assets": {"blue": {"href": "http://test.dev/image.tif"},
"thumbnail": {"href": "http://test.dev/thumbnail.png"}},
}
],
}
Expand Down

0 comments on commit 33dbbf0

Please sign in to comment.