Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better check obj name resolution #283

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

with:
# Optional
version: 2.17.0
version: 2.29.2

# Optional
styles: |
Expand Down
4 changes: 3 additions & 1 deletion oda_api/gallery_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@
src_name_list = src_name_arg

for src_name in src_name_list:
resolved_source = False
resolved_source = True

Check warning on line 672 in oda_api/gallery_api.py

View check run for this annotation

Codecov / codecov/patch

oda_api/gallery_api.py#L672

Added line #L672 was not covered by tests
entity_portal_link = None
object_ids = None
object_type = None
Expand All @@ -681,6 +681,7 @@
msg = ''
if 'message' in resolved_obj:
if 'could not be resolved' in resolved_obj['message']:
resolved_source = False

Check warning on line 684 in oda_api/gallery_api.py

View check run for this annotation

Codecov / codecov/patch

oda_api/gallery_api.py#L684

Added line #L684 was not covered by tests
msg = f'\nSource {src_name} could not be validated'
elif 'successfully resolved' in resolved_obj['message']:
resolved_source = True
Expand Down Expand Up @@ -710,6 +711,7 @@
object_ids = resolved_obj['object_ids']
else:
logger.warning(f"{src_name} could not be validated")
resolved_source = False

Check warning on line 714 in oda_api/gallery_api.py

View check run for this annotation

Codecov / codecov/patch

oda_api/gallery_api.py#L714

Added line #L714 was not covered by tests

if not resolved_source and not force_insert_not_valid_new_source:
# a source won't be added
Expand Down
1 change: 1 addition & 0 deletions tests/test_drupal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@
assert 'object_ids' in resolved_obj
assert 'RA' in resolved_obj
assert 'DEC' in resolved_obj
assert 'message' in resolved_obj

Check warning on line 1009 in tests/test_drupal.py

View check run for this annotation

Codecov / codecov/patch

tests/test_drupal.py#L1009

Added line #L1009 was not covered by tests

quoted_source_name = urllib.parse.quote(source_name.strip())

Expand Down
Loading