Skip to content

Commit b9d03e1

Browse files
committed
Fix: add simple test
Fix: more dtis
1 parent 0d20e43 commit b9d03e1

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

src/pyosmeta/parse_issues.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,9 @@ def _get_line_meta(self, line_item: list[str]) -> dict[str, object]:
431431
432432
Returns
433433
-------
434-
Dict containing the metadata for a submitting author, reviewer or
435-
maintainer(s)
434+
Dict
435+
Containing the metadata for a submitting author, reviewer or
436+
maintainer(s)
436437
"""
437438

438439
meta = {}

tests/unit/test_review_model.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from pyosmeta.parse_issues import ReviewModel
2+
3+
# We could setup some example data using fixtures and a conf.py
4+
# Once we have a better view of the test suite.
5+
example = {
6+
"submitting_author": {
7+
"github_username": "nabobalis",
8+
"name": "Nabil Freij",
9+
},
10+
"all_current_maintainers": [],
11+
"package_name": "sunpy",
12+
"one-line_description_of_package": "Python for Solar Physics",
13+
"repository_link": "https://github.com/sunpy/sunpy",
14+
"version_submitted": "5.0.1",
15+
"editor": {"github_username": "cmarmo", "name": ""},
16+
"reviewer_1": {"github_username": "Septaris", "name": ""},
17+
"reviewer_2": {"github_username": "nutjob4life", "name": ""},
18+
"archive": "[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8384174.svg)](https://doi.org/10.5281/zenodo.8384174)",
19+
"version_accepted": "5.1.1",
20+
"joss_doi": "[![DOI](https://joss.theoj.org/papers/10.21105/joss.01832/status.svg)](https://joss.theoj.org/papers/10.21105/joss.01832)",
21+
"date_accepted_(month/day/year)": "01/18/2024",
22+
"categories": [
23+
"data-retrieval",
24+
"data-extraction",
25+
"data-processing/munging",
26+
"data-visualization",
27+
],
28+
}
29+
30+
31+
def test_alias_choices_validation():
32+
"""Test that model correctly recognizes the field alias"""
33+
34+
new = ReviewModel(**example)
35+
assert new.date_accepted == "2024-01-18"
36+
assert new.package_description == "Python for Solar Physics"

0 commit comments

Comments
 (0)