New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce duplication in DOI tests #4644

Merged
merged 1 commit into from Sep 11, 2017

Conversation

Projects
None yet
2 participants
@robertknight
Contributor

robertknight commented Sep 7, 2017

There were essentially two sets of tests for the doi_uri_from_string
function, one that tested usage for strings extracted from <meta name="dc.identifier"> tags and one for strings extracted from <meta name="citation_doi"> tags.

This commit adds a class that tests the doi_uri_from_string function
directly in detail and simplifies the indirect testing via
document_uris_from_{dc, highwire_doi}.

Reduce duplication in DOI tests
There were essentially two sets of tests for the `doi_uri_from_string`
function, one that tested usage for strings extracted from `<meta
name="dc.identifier">` tags and one for strings extracted from `<meta
name="citation_doi">` tags.

This commit adds a class that tests the `doi_uri_from_string` function
directly in detail and simplifies the indirect tests via
`document_uris_from_{dc, highwire_doi}`.
@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Sep 7, 2017

Codecov Report

Merging #4644 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4644      +/-   ##
==========================================
+ Coverage   95.19%   95.24%   +0.04%     
==========================================
  Files         373      373              
  Lines       20457    20892     +435     
  Branches     1176     1222      +46     
==========================================
+ Hits        19474    19898     +424     
- Misses        879      890      +11     
  Partials      104      104
Impacted Files Coverage Δ
tests/h/util/document_claims_test.py 100% <100%> (ø) ⬆️
tests/h/services/rename_user_test.py 100% <0%> (ø) ⬆️
h/views/groups.py 100% <0%> (ø) ⬆️
h/views/api.py 100% <0%> (ø) ⬆️
h/routes.py 100% <0%> (ø) ⬆️
tests/h/views/api_auth_test.py 99.67% <0%> (+0.09%) ⬆️
tests/h/views/api_test.py 99.41% <0%> (+0.22%) ⬆️
h/views/accounts.py 90.9% <0%> (+0.46%) ⬆️
h/services/rename_user.py 98.36% <0%> (+0.53%) ⬆️
tests/h/views/groups_test.py 95.91% <0%> (+0.75%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c31d5e2...9858d31. Read the comment docs.

codecov bot commented Sep 7, 2017

Codecov Report

Merging #4644 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4644      +/-   ##
==========================================
+ Coverage   95.19%   95.24%   +0.04%     
==========================================
  Files         373      373              
  Lines       20457    20892     +435     
  Branches     1176     1222      +46     
==========================================
+ Hits        19474    19898     +424     
- Misses        879      890      +11     
  Partials      104      104
Impacted Files Coverage Δ
tests/h/util/document_claims_test.py 100% <100%> (ø) ⬆️
tests/h/services/rename_user_test.py 100% <0%> (ø) ⬆️
h/views/groups.py 100% <0%> (ø) ⬆️
h/views/api.py 100% <0%> (ø) ⬆️
h/routes.py 100% <0%> (ø) ⬆️
tests/h/views/api_auth_test.py 99.67% <0%> (+0.09%) ⬆️
tests/h/views/api_test.py 99.41% <0%> (+0.22%) ⬆️
h/views/accounts.py 90.9% <0%> (+0.46%) ⬆️
h/services/rename_user.py 98.36% <0%> (+0.53%) ⬆️
tests/h/views/groups_test.py 95.91% <0%> (+0.75%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c31d5e2...9858d31. Read the comment docs.

@seanh

seanh approved these changes Sep 11, 2017

)
assert [d['uri'] for d in document_uris] == ['doi:foo']
assert len(document_uris) == 0

This comment has been minimized.

@seanh

seanh Sep 11, 2017

Contributor

Stylistically I think this should be assert not document_uris in Python (pylint would complain about this I believe)

@seanh

seanh Sep 11, 2017

Contributor

Stylistically I think this should be assert not document_uris in Python (pylint would complain about this I believe)

@seanh seanh merged commit e491760 into master Sep 11, 2017

6 checks passed

codecov/patch 100% of diff hit (target 95.19%)
Details
codecov/project 95.24% (+0.04%) compared to c31d5e2
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
hound No violations found. Woof!
pyup.io/safety-ci No dependencies with known security vulnerabilities.
Details

@seanh seanh deleted the dedupe-doi-tests branch Sep 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment