Skip to content

Commit c397ddc

Browse files
committed
fix empty dict check
1 parent 8b77036 commit c397ddc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pycsw/stac/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ def items(self, headers_, json_post_data, args, collection='metadata:main'):
594594
links2 = []
595595

596596
for link in response2.get('links', []):
597-
if json_post_data is not None:
598-
LOGGER.debug('Adding link body')
597+
if json_post_data:
598+
LOGGER.debug('Adding link method and body')
599599
link['method'] = 'POST'
600600
link['body'] = json_post_data
601601

tests/functionaltests/suites/stac_api/test_stac_api_functional.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ def test_items(config):
171171
assert 'href' in link
172172
assert 'rel' in link
173173
assert 'metadata:main' not in link['href']
174+
assert 'method' not in link
175+
assert 'body' not in link
174176

175177
# test GET KVP requests
176178
content = json.loads(api.items({}, None, {'bbox': '-180,-90,180,90'})[2])

0 commit comments

Comments
 (0)