Skip to content

Commit

Permalink
Parsers: include all CC BY variations
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnestaP committed Jun 27, 2024
1 parent 7521c92 commit 61707f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions dags/open_access/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def is_correct_value(value):


def field_has_cc_by(field_value):
# is CC BY-SA 4.0 falls under the condition of "contains ‘CC-BY’ or ‘CC BY’??
#
pattern = re.compile(r"CC(\s|-)?BY(\s|-)?4.0", flags=re.I)
pattern = re.compile(r"CC(\s|-)?BY(\s|-)?.*", flags=re.I)
return bool(pattern.match(field_value))


Expand Down
3 changes: 2 additions & 1 deletion tests/open_access/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"2882429",
"2882335",
"2882328",
"2882327",
"2882324",
"2882322",
"2882311",
Expand Down Expand Up @@ -100,7 +101,7 @@ def test_parse_subset_540_publications(shared_datadir):
)
if is_it_wanted_record_by_540:
filtered_records_count = filtered_records_count + 1
assert filtered_records_count == 14
assert filtered_records_count == 15


def test_get_green_access_records_dois(shared_datadir):
Expand Down

0 comments on commit 61707f5

Please sign in to comment.