Skip to content

Commit

Permalink
Remove tests from 2.1 and 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Jun 13, 2023
1 parent 6086173 commit 08a6fce
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 117 deletions.
30 changes: 8 additions & 22 deletions orcid/test_21api_all_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def test_othername20(self):
jsontext = '"display-index":0,"content":"Second Name"}'
self.bio20('20postname.xml', 'other-names', 'other-names', jsontext, 'First name', 'Second Name', 'Other name')

def test_country20(self):
jsontext = '"country":{"value":"CR"}}'
self.bio20('20postaddress.xml', 'address', 'address', jsontext, 'GB', 'CR', 'US')
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_address_v21.cy.js

def test_keywords20(self):
jsontext = '"content":"oranges"}'
Expand All @@ -148,29 +146,17 @@ def test_researcherurls20(self):
jsontext = '"url-name":"Bing","url":{"value":"www.bing.com"}}'
self.bio20('20posturl.xml', 'researcher-urls', 'researcher-urls', jsontext, 'Yahoo', 'Bing', 'Google')

def test_identifiers20(self):
jsontext = '"external-id-type":"Personal External Identifier","external-id-value":"twenty-nine","external-id-url":{"value":"www.29.com"},"external-id-relationship":"SELF"}'
self.bio20('20postid.xml', 'external-identifiers', 'external-identifiers', jsontext, 'A-0003', 'twenty-nine', '1234567')

def test_education20(self):
jsontext = '"department-name":"Rocket Science","role-title":"BA","organization":{"name":"Massachusetts Institute of Technology","address":{"city":"Cambridge","region":"MA","country":"US"},"disambiguated-organization" : {"disambiguated-organization-identifier":"2167","disambiguation-source" : "RINGGOLD"}}}'
self.bio20('20postedu.xml', 'education', 'educations', jsontext, 'Art History', 'Rocket Science', 'Car Repair')
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_externalids_v21.cy.js

# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_education_v21.cy.js

def test_employment20(self):
jsontext = '"organization":{"name":"University of Oxford ","address":{"city":"Oxford","region":"Oxfordshire","country":"GB"},"disambiguated-organization" : {"disambiguated-organization-identifier":"6396","disambiguation-source" : "RINGGOLD"}}}'
self.bio20('20postemploy.xml', 'employment', 'employments', jsontext, 'Annapolis', 'Oxford', 'ORCID')
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_employment_v21.cy.js

def test_funding20(self):
jsontext = '"title":{"title":{"value":"Funding to researcher identifiers"}},"external-ids":{"external-id":[{"external-id-type":"grant_number","external-id-value":"7777","external-id-url":null,"external-id-relationship":"SELF"}]},"type":"GRANT","organization":{"name":"Wellcome Trust","address":{"city":"London","region":null,"country":"GB"},"disambiguated-organization":{"disambiguated-organization-identifier":"http://dx.doi.org/10.13039/100004440","disambiguation-source":"FUNDREF"}}}'
self.works20('20postfund.xml', 'funding', 'fundings', jsontext, '6666', '7777', '8888')
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_funding_v21.cy.js

def test_works20(self):
jsontext = '"title":{"title":{"value":"Catcher in the Rye"}},"type":"BOOK","external-ids":{"external-id":[{"external-id-type":"doi","external-id-value":"1234","external-id-url":null,"external-id-relationship":"SELF"}]}}'
self.works20('20postwork.xml', 'work', 'works', jsontext, 'Great Expectations', 'Catcher in the Rye', 'Harry Potter')
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_work_v21.cy.js

def test_peer20(self):
jsontext = '"reviewer-role" : "REVIEWER", "review-identifiers" : { "external-id" : [ {"external-id-type" : "source-work-id","external-id-value" : "6666", "external-id-url" : null,"external-id-relationship" : "SELF"} ] }, "review-url" : null, "review-type" : "REVIEW", "review-completion-date" : { "year" : { "value" : "2006" }}, "review-group-id" : "issn:0953-1513", "convening-organization" : { "name" : "ORCID", "address" : { "city" : "Bethesda", "region" : "MD", "country" : "US" }, "disambiguated-organization" : {"disambiguated-organization-identifier" : "385488", "disambiguation-source" : "RINGGOLD" }}}'
self.bio20('20postpeer.xml', 'peer-review', 'peer-reviews', jsontext, '5555', '6666', '13')
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_peerReview_v21.cy.js

def test_peerreview_group(self):
#search for and read a peer-review group with an issn group id
Expand Down
38 changes: 10 additions & 28 deletions orcid/test_30api_all_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ def test_othername30(self):
jsontext = '"display-index":0,"content":"Second Name"}'
self.bio20('20postname.xml', 'other-names', 'other-names', jsontext, 'First name', 'Second Name', 'Other name')

def test_country30(self):
jsontext = '"country":{"value":"CR"}}'
self.bio20('20postaddress.xml', 'address', 'address', jsontext, 'GB', 'CR', 'US')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_address_v30.cy.js

def test_keywords30(self):
jsontext = '"content":"oranges"}'
Expand All @@ -149,25 +147,15 @@ def test_researcherurls30(self):
jsontext = '"url-name":"Bing","url":{"value":"www.bing.com"}}'
self.bio20('20posturl.xml', 'researcher-urls', 'researcher-urls', jsontext, 'Yahoo', 'Bing', 'Google')

def test_identifiers30(self):
jsontext = '"external-id-type":"Personal External Identifier","external-id-value":"twenty-nine","external-id-url":{"value":"www.29.com"},"external-id-relationship":"self"}'
self.bio20('20postid.xml', 'external-identifiers', 'external-identifiers', jsontext, 'A-0003', 'twenty-nine', '1234567')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_externalids_v30.cy.js

def test_education30(self):
jsontext = '"department-name":"Rocket Science","role-title":"BA","start-date" : {"year" : {"value" : "2000"}},"organization":{"name":"Massachusetts Institute of Technology","address":{"city":"Cambridge","region":"MA","country":"US"},"disambiguated-organization" : {"disambiguated-organization-identifier":"2167","disambiguation-source" : "RINGGOLD"}}}'
self.bio20('30postedu.xml', 'education', 'educations', jsontext, 'Art History', 'Rocket Science', 'Car Repair')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_education_v30.cy.js

def test_employ30(self):
jsontext = '"department-name":"Rocket Science","role-title":"BA","start-date" : {"year" : {"value" : "2001"}},"organization":{"name":"University of Oxford ","address":{"city":"Oxford","region":"Oxfordshire","country":"GB"},"disambiguated-organization" : {"disambiguated-organization-identifier":"6396","disambiguation-source" : "RINGGOLD"}}}'
self.bio20('30postemploy.xml', 'employment', 'employments', jsontext, 'Annapolis', 'Oxford', 'ORCID')

def test_distinction30(self):
jsontext = '"department-name":"Rocket Science","role-title":"BA","start-date" : {"year" : {"value" : "2001"},"month" : {"value" : "07"},"day" : {"value" : "02"}},"organization":{"name":"University of Oxford","address":{"city":"Oxford","region":"Oxfordshire","country":"GB"},"disambiguated-organization" : {"disambiguated-organization-identifier":"grid.4991.5","disambiguation-source" : "GRID"}}}'
self.bio20('30postdistinct.xml', 'distinction', 'distinctions', jsontext, 'Annapolis', 'Oxford', 'Swarthmore')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_employment_v30.cy.js

# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_distinction_v30.cy.js

def test_invited30(self):
jsontext = '"start-date" : {"year" : {"value" : "2001"}},"organization":{"name":"Harvard University","address":{"city":"Cambridge","region":"MA","country":"US"},"disambiguated-organization" : {"disambiguated-organization-identifier":"grid.38142.3c","disambiguation-source" : "GRID"}},"external-ids" : {"external-id" : [ {"external-id-type" : "grant_number","external-id-value" : "external-identifier-value3","external-id-relationship" : "self"}]}}'
self.bio20('30postinvited.xml', 'invited-position', 'invited-positions', jsontext, 'Digital', 'Harvard', 'Oberlin')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_invited_position_v30.cy.js

def test_membership30(self):
jsontext = '"department-name":"Rocket Science","role-title":"BA","start-date" : {"year" : {"value" : "2001"}},"organization":{"name":"University of Oxford ","address":{"city":"Oxford","region":"Oxfordshire","country":"GB"},"disambiguated-organization" : {"disambiguated-organization-identifier":"6396","disambiguation-source" : "RINGGOLD"}}}'
Expand All @@ -181,21 +169,15 @@ def test_service30(self):
jsontext = '"department-name":"Rocket Science","role-title":"BA","start-date" : {"year" : {"value" : "2001"}},"organization":{"name":"University of Oxford","address":{"city":"Oxford","region":"Oxfordshire","country":"GB"},"disambiguated-organization" : {"disambiguated-organization-identifier":"6396","disambiguation-source" : "RINGGOLD"}}}'
self.bio20('30postservice.xml', 'service', 'services', jsontext, 'Annapolis', 'Oxford', 'ORCID')

def test_funding30(self):
jsontext = '"title":{"title":{"value":"Funding to researcher identifiers"}},"external-ids":{"external-id":[{"external-id-type":"grant_number","external-id-value":"7777","external-id-url":null,"external-id-relationship":"self"}]},"type":"grant","organization":{"name":"Wellcome Trust","address":{"city":"London","region":null,"country":"GB"},"disambiguated-organization":{"disambiguated-organization-identifier":"http://dx.doi.org/10.13039/100004440","disambiguation-source":"FUNDREF"}}}'
self.works20('30postfund.xml', 'funding', 'fundings', jsontext, '6666', '7777', '8888')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_funding_v30.cy.js

def test_researchresource30(self):
jsontext = '"proposal":{"title":{"title":{"value":"Special Collections Access Request"}},"hosts":{"organization":[{"name":"Yale University Beinecke Rare Book and Manuscript Library","address":{"city":"New Haven","region":"CT","country":"US"},"disambiguated-organization":{"disambiguated-organization-identifier":"508080","disambiguation-source":"RINGGOLD"}}]},"external-ids":{"external-id":[{"external-id-type":"source-work-id","external-id-value":"1004","external-id-relationship":"self"}]}},"resource-item":[{"resource-name":"Special Collection","resource-type":"collections","hosts":{"organization":[{"name":"Yale University Beinecke Rare Book and Manuscript Library","address":{"city":"New Haven","region":"CT","country":"US"},"disambiguated-organization":{"disambiguated-organization-identifier":"508080","disambiguation-source":"RINGGOLD"}}]},"external-ids":{"external-id":[{"external-id-type":"source-work-id","external-id-value":"1100","external-id-relationship":"self"}]}}]}'
self.works20('30postrr.xml', 'research-resource', 'research-resources', jsontext, 'Clements', 'Beinecke', 'Laser')

def test_works30(self):
jsontext = '"title":{"title":{"value":"Catcher in the Rye"}},"type":"book","external-ids":{"external-id":[{"external-id-type":"doi","external-id-value":"1234","external-id-url":null,"external-id-relationship":"self"}]}}'
self.works20('20postwork.xml', 'work', 'works', jsontext, 'Great Expectations', 'Catcher in the Rye', 'Harry Potter')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_work_v30.cy.js

def test_peer20(self):
jsontext = '"reviewer-role" : "reviewer", "review-identifiers" : { "external-id" : [ {"external-id-type" : "source-work-id","external-id-value" : "6666", "external-id-url" : null,"external-id-relationship" : "self"} ] }, "review-url" : null, "review-type" : "review", "review-completion-date" : { "year" : { "value" : "2006" }}, "review-group-id" : "issn:1741-4857", "convening-organization" : { "name" : "Crossref", "address" : { "city" : "Lynnfield", "region" : "MA", "country" : "US" }, "disambiguated-organization" : {"disambiguated-organization-identifier" : "grid.466633.2", "disambiguation-source" : "GRID" }}}'
self.bio20('30postpeer.xml', 'peer-review', 'peer-reviews', jsontext, '5555', '6666', '13')
# https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v3_0/crud_peerReview_v30.cy.js

def test_peerreview_group(self):
#search for and read a peer-review group with an issn group id
Expand Down
39 changes: 6 additions & 33 deletions orcid/test_member21_api_post_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,13 @@ def setUp(self):
self.access, self.refresh = self.orcid_exchange_auth_token(self.client_id, self.client_secret, self.code)


def test_post_update_work(self):
# Test Post the ma test work 2
response = self.post_activity(self.version, "work", "ma21_work.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)
putcode = self.get_putcode_from_response(response)
print (putcode)
self.assertIsNotNone(putcode,"Not valid putcode returned: [%s]" % str(putcode))
# Update the work with JSON
self.assertFalse("" == putcode, "Empty putcode in url")
updated_data = '{"put-code":' + str(putcode) + ',"title":{"title":"APITestTitleUpdated21"},"type":"JOURNAL_ARTICLE","external-ids":{"external-id":[{"external-id-value":"4321","external-id-type":"doi","external-id-relationship":"SELF"}]}}'
update_response = self.update_activity(self.version, putcode, updated_data, "work")
self.assertTrue("HTTP/1.1 200" in update_response, str(putcode) + " > Update Action Response: " + update_response + " with data [%s]" % updated_data)
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_work_v21.cy.js

# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_education_v21.cy.js

def test_post_education(self):
# Test Post education item to the record created today using the 2.1 api
response = self.post_activity(self.version, "education", "ma21_edu.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_funding_v21.cy.js

def test_post_funding(self):
# Test Post funding to the record created today using the 2.1 api
response = self.post_activity(self.version, "funding", "ma21_fund2.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)

def test_post_peerreview(self):
# Test Post peer review to the record created today using the 2.1 api
response = self.post_activity(self.version, "peer-review", "ma21_peer2.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_peerReview_v21.cy.js

def test_post_update_keyword(self):
# Test Post keyword to the record created today using the 2.1 api and test updating using put
Expand All @@ -71,20 +50,14 @@ def test_post_othername(self):
response = self.post_activity(self.version, "other-names", "ma21_othername.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)

def test_post_country(self):
# Test Post country to the record created today using the 2.1 api
response = self.post_activity(self.version, "address", "ma21_country.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_address_v21.cy.js

def test_post_website(self):
# Test Post website to the record created today using the 2.1 api
response = self.post_activity(self.version, "researcher-urls", "ma21_website.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)

def test_post_identifier(self):
# Test Post personal identifier to the record created today using the 2.1 api
response = self.post_activity(self.version, "external-identifiers", "ma21_identifier.xml")
self.assertTrue("HTTP/1.1 201" in response, "Response missing \"201\" code: " + response)
# Removed, covered here: https://github.com/ORCID/orcid-cypress_tests-private/blob/main/cypress/e2e/mapi/v2_1/crud_externalids_v21.cy.js

def test_post_update_notification(self):
# Test Post notification to the record created today using the 2.1 api
Expand Down
Loading

0 comments on commit 08a6fce

Please sign in to comment.