forked from ckan/ckanext-scheming
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted private function as helper, created unit test to reproduce …
…the bug and fixed the issue.
- Loading branch information
1 parent
db747aa
commit f754a1f
Showing
3 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pytest | ||
|
||
from ckanext.scheming.unaids_helpers import comma_swap_formatter | ||
|
||
|
||
@pytest.mark.parametrize("input,expected", | ||
[("no_commas", "no_commas"), | ||
("comma,split", "split comma"), | ||
("Tanzania, Republic of", "Republic of Tanzania") | ||
]) | ||
def test_comma_swap_formatter(input, expected): | ||
actual = comma_swap_formatter(input) | ||
assert actual == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters