Skip to content

Commit

Permalink
Improve testing
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Jan 13, 2025
1 parent e1246e0 commit a4e9477
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
28 changes: 28 additions & 0 deletions tests/data/reviews/archives_invalid.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Submitting Author: Fakename (@fakeauthor)
All current maintainers: (@fakeauthor1, @fakeauthor2)
Package Name: fake_package
One-Line Description of Package: A fake python package
Repository Link: https://example.com/fakeauthor1/fake_package
Version submitted: v1.0.0
EiC: @fakeeic
Editor: @fakeeditor
Reviewer 1: @fakereviewer1
Reviewer 2: @fakereviewer2
Reviews Expected By: fake date
Archive: 10.1234/zenodo.12345678
JOSS DOI: 10.21105/joss.00000
Version accepted: 2.0.0 ([repo](https://example.com/fakeauthor1/fake_package/releases/tag/v2.0.0), [pypi](https://pypi.org/project/fake_project/2.0.0), [archive](https://example.com/fakearchive))
Date accepted (month/day/year): 06/29/2024

---

## Scope

- [x] I agree to abide by [pyOpenSci's Code of Conduct][PyOpenSciCodeOfConduct] during the review process and in maintaining my package after should it be accepted.
- [x] I have read and will commit to package maintenance after the review as per the [pyOpenSci Policies Guidelines][Commitment].
(etc)

## Community Partnerships

- [ ] etc
- [ ] aaaaaa
28 changes: 28 additions & 0 deletions tests/data/reviews/archives_missing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Submitting Author: Fakename (@fakeauthor)
All current maintainers: (@fakeauthor1, @fakeauthor2)
Package Name: fake_package
One-Line Description of Package: A fake python package
Repository Link: https://example.com/fakeauthor1/fake_package
Version submitted: v1.0.0
EiC: @fakeeic
Editor: @fakeeditor
Reviewer 1: @fakereviewer1
Reviewer 2: @fakereviewer2
Reviews Expected By: fake date
Archive:
JOSS DOI:
Version accepted: 2.0.0 ([repo](https://example.com/fakeauthor1/fake_package/releases/tag/v2.0.0), [pypi](https://pypi.org/project/fake_project/2.0.0), [archive](https://example.com/fakearchive))
Date accepted (month/day/year): 06/29/2024

---

## Scope

- [x] I agree to abide by [pyOpenSci's Code of Conduct][PyOpenSciCodeOfConduct] during the review process and in maintaining my package after should it be accepted.
- [x] I have read and will commit to package maintenance after the review as per the [pyOpenSci Policies Guidelines][Commitment].
(etc)

## Community Partnerships

- [ ] etc
- [ ] aaaaaa
File renamed without changes.
12 changes: 11 additions & 1 deletion tests/integration/test_parse_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@ def test_parse_doi_archives(process_issues, data_file):
assert review.archive == "https://zenodo.org/record/8415866"
assert review.joss == "http://joss.theoj.org/papers/10.21105/joss.01450"

review = data_file("reviews/unknown_archives.txt", True)
review = data_file("reviews/archives_unknown.txt", True)
review = process_issues.parse_issue(review)
assert review.archive is None
assert review.joss is None

review = data_file("reviews/archives_missing.txt", True)
review = process_issues.parse_issue(review)
assert review.archive is None
assert review.joss is None

review = data_file("reviews/archives_invalid.txt", True)

with pytest.raises(ValueError):
review = process_issues.parse_issue(review)


def test_parse_labels(issue_list, process_issues):
"""
Expand Down

0 comments on commit a4e9477

Please sign in to comment.