Skip to content

Commit

Permalink
Merge pull request CenterForOpenScience#10700 from Johnetordoff/add-t…
Browse files Browse the repository at this point in the history
…est-for-SHARE-preprint-focus

[ENG-5908] Add Test Confirming Preprint Affiliated Iinstitution Data is Sent to SHARE
  • Loading branch information
cslzchen authored Aug 12, 2024
2 parents a362241 + 55d4b74 commit 33af3e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions osf_tests/metadata/test_osf_gathering.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ def test_gather_affiliated_institutions(self):
institution_iri = URIRef(institution.ror_uri)
self.user__admin.add_or_update_affiliated_institution(institution)
self.project.add_affiliated_institution(institution, self.user__admin)
self.preprint.add_affiliated_institution(institution, self.user__admin)
assert_triples(osf_gathering.gather_affiliated_institutions(self.projectfocus), {
(self.projectfocus.iri, OSF.affiliation, institution_iri),
(institution_iri, RDF.type, DCTERMS.Agent),
Expand All @@ -559,6 +560,15 @@ def test_gather_affiliated_institutions(self):
assert_triples(osf_gathering.gather_affiliated_institutions(self.registrationfocus), set())
# focus: file
assert_triples(osf_gathering.gather_affiliated_institutions(self.filefocus), set())
# focus: preprint
assert_triples(osf_gathering.gather_affiliated_institutions(self.preprintfocus), {
(self.preprintfocus.iri, OSF.affiliation, institution_iri),
(institution_iri, RDF.type, DCTERMS.Agent),
(institution_iri, RDF.type, FOAF.Organization),
(institution_iri, FOAF.name, Literal(institution.name)),
(institution_iri, DCTERMS.identifier, Literal(institution.identifier_domain)),
(institution_iri, DCTERMS.identifier, Literal(institution.ror_uri)),
})

def test_gather_funding(self):
# focus: project
Expand Down

0 comments on commit 33af3e7

Please sign in to comment.