Skip to content

Commit

Permalink
Merge pull request #104 from MITLibraries/TIMX-241-springshare-oai-dates
Browse files Browse the repository at this point in the history
Timx 241 springshare oai dates
  • Loading branch information
ghukill authored Aug 28, 2023
2 parents 094c0df + 9c28431 commit 8f2d068
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/test_oai_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ def test_oaidc_generic_date():
transformer_instance = OaiDc("libguides", input_records)
xml = next(transformer_instance.input_records)
assert transformer_instance.get_dates("test_source_record_id", xml) == [
timdex.Date(kind=None, note=None, range=None, value="2008-06-19T17:55:27")
timdex.Date(kind="Unknown", note=None, range=None, value="2008-06-19T17:55:27")
]
8 changes: 5 additions & 3 deletions tests/test_springshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def test_springshare_get_dates_valid():
for xml in transformer_instance.input_records:
date_field_value = transformer_instance.get_dates("test_get_dates", xml)
assert date_field_value == [
timdex.Date(kind=None, note=None, range=None, value="2000-01-01T00:00:00")
timdex.Date(
kind="Created", note=None, range=None, value="2000-01-01T00:00:00"
)
]


Expand Down Expand Up @@ -106,7 +108,7 @@ def test_libguide_transform_with_all_fields_transforms_correctly():
)
],
dates=[
timdex.Date(value="2008-06-19T17:55:27"),
timdex.Date(value="2008-06-19T17:55:27", kind="Created"),
],
format="electronic resource",
identifiers=[
Expand Down Expand Up @@ -160,7 +162,7 @@ def test_research_databases_transform_with_all_fields_transforms_correctly():
"researchdatabases. https://libguides.mit.edu/llba",
content_type=["researchdatabases"],
dates=[
timdex.Date(value="2022-01-28T22:15:37"),
timdex.Date(value="2022-01-28T22:15:37", kind="Created"),
],
format="electronic resource",
identifiers=[
Expand Down
2 changes: 1 addition & 1 deletion transmogrifier/sources/oaidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_dates(self, source_record_id: str, xml: Tag) -> Optional[List[timdex.Dat
date_str,
source_record_id,
):
dates.append(timdex.Date(value=date_str))
dates.append(timdex.Date(value=date_str, kind="Unknown"))
return dates or None

def get_links(self, source_record_id: str, xml: Tag) -> Optional[List[timdex.Link]]:
Expand Down
2 changes: 1 addition & 1 deletion transmogrifier/sources/springshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_dates(self, source_record_id: str, xml: Tag) -> Optional[List[timdex.Dat
date_iso_str,
source_record_id,
):
dates.append(timdex.Date(value=date_iso_str, kind=None))
dates.append(timdex.Date(value=date_iso_str, kind="Created"))
return dates or None

def get_links(self, source_record_id: str, xml: Tag) -> Optional[List[timdex.Link]]:
Expand Down

0 comments on commit 8f2d068

Please sign in to comment.