|
1 | 1 | import pytest |
2 | 2 |
|
3 | | -from pyosmeta.parse_issues import ProcessIssues |
| 3 | +from pyosmeta.parse_issues import ProcessIssues, ReviewModel |
4 | 4 |
|
5 | 5 | checked = [ |
6 | 6 | ["Submitting Author", "Nabil Freij (@nabobalis)"], |
@@ -65,3 +65,37 @@ def test_get_categories( |
65 | 65 |
|
66 | 66 | # Assert the result matches the expected categories |
67 | 67 | assert categories == expected_categories |
| 68 | + |
| 69 | + |
| 70 | +@pytest.mark.parametrize( |
| 71 | + "input_categories,expected_return", |
| 72 | + [ |
| 73 | + ( |
| 74 | + ["data-processing"], |
| 75 | + ["data-processing-munging"], |
| 76 | + ), |
| 77 | + ( |
| 78 | + ["data-processing/munging"], |
| 79 | + ["data-processing-munging"], |
| 80 | + ), |
| 81 | + ( |
| 82 | + ["scientific-software and friends"], |
| 83 | + ["scientific-software-wrapper"], |
| 84 | + ), |
| 85 | + ( |
| 86 | + ["data-validation and things -testing"], |
| 87 | + ["data-validation-testing"], |
| 88 | + ), |
| 89 | + ( |
| 90 | + ["data-processing", "data-extraction"], |
| 91 | + ["data-processing-munging", "data-extraction"], |
| 92 | + ), |
| 93 | + ], |
| 94 | +) |
| 95 | +def test_clean_categories( |
| 96 | + input_categories: list[str], expected_return: list[str] |
| 97 | +): |
| 98 | + """Test that ensures our pydantic model cleans categories as expected""" |
| 99 | + |
| 100 | + review = ReviewModel(categories=input_categories) |
| 101 | + assert review.categories == expected_return |
0 commit comments