Skip to content

Commit

Permalink
Field method refactor for Springshare transform
Browse files Browse the repository at this point in the history
Why these changes are being introduced:
* These updates are required to implement the architecture described
in the following ADR: https://github.com/MITLibraries/transmogrifier/blob/main/docs/adrs/0005-field-methods.md

How this addresses that need:
* Refactor transform class SpringshareOaiDc to contain get_*
methods for optional fields
* Update tests for SpringshareOaiDc transform

Side effects of this change:
* None

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/TIMX-283
  • Loading branch information
jonavellecuerdo committed May 22, 2024
1 parent cc1c097 commit 8b946ff
Show file tree
Hide file tree
Showing 3 changed files with 316 additions and 91 deletions.
34 changes: 34 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,40 @@ def oai_pmh_records():
return XMLTransformer.parse_source_file("tests/fixtures/oai_pmh_records.xml")


# springshare - libguides ##########################
@pytest.fixture
def springshare_libguides_record_optional_fields_blank():
source_records = OaiDc.parse_source_file(
"tests/fixtures/oai_dc/springshare/libguides/libguides_record_optional_fields_blank.xml"
)
return next(source_records)


@pytest.fixture
def springshare_libguides_record_optional_fields_missing():
source_records = OaiDc.parse_source_file(
"tests/fixtures/oai_dc/springshare/libguides/libguides_record_optional_fields_missing.xml"
)
return next(source_records)


# springshare - research databases ##########################
@pytest.fixture
def springshare_research_databases_record_optional_fields_blank():
source_records = OaiDc.parse_source_file(
"tests/fixtures/oai_dc/springshare/research_databases/research_databases_record_optional_fields_blank.xml"
)
return next(source_records)


@pytest.fixture
def springshare_research_databases_record_optional_fields_missing():
source_records = OaiDc.parse_source_file(
"tests/fixtures/oai_dc/springshare/research_databases/research_databases_record_optional_fields_missing.xml"
)
return next(source_records)


@pytest.fixture
def timdex_record_required_fields():
return timdex.TimdexRecord(
Expand Down
Loading

0 comments on commit 8b946ff

Please sign in to comment.