|
| 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": "[](https://doi.org/10.5281/zenodo.8384174)", |
| 19 | + "version_accepted": "5.1.1", |
| 20 | + "joss_doi": "[](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