stac-utils / stac-fastapi-elasticsearch-opensearch

Elasticsearch backend for stac-fastapi with Opensearch support.
https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch
MIT License
28 stars 13 forks source link

Repair API sort tests #264

Closed jamesfisher-geo closed 4 months ago

jamesfisher-geo commented 4 months ago

Related Issue(s):

Description:

Edit to four tests of the sort extension. The timezone Z character was not being included with the .replace command. So it was removed and Z is appended to the datetime string.

PR Checklist:

jonhealy1 commented 4 months ago

Hi @jamesfisher-gis. So sorting is working as usual with the API - outside of the tests?

jamesfisher-geo commented 4 months ago

Yes. There is no issue with the sorting logic. The issue was that the tests had updated so that a datetime object was being subtracted from a datetime string yielding this error and a failed test., for example

FAILED api/test_api.py::test_app_sort_extension_get_asc - TypeError: unsupported operand type(s) for -: 'str' and 'datetime.timedelta'

I have updated the tests so that it always uses a datetime object

jamesfisher-geo commented 4 months ago

Are you able to reproduce the issue in #262?

jonhealy1 commented 4 months ago

Yes I am getting the same test errors