mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-22 13:55:03 +01:00
Add tests for unnecessary multi-value separators
This commit is contained in:
parent
32cea2055f
commit
29e67a0887
@ -59,6 +59,19 @@ def test_check_invalid_separators(capsys):
|
|||||||
assert captured.out == f"Invalid multi-value separator ({field_name}): {value}\n"
|
assert captured.out == f"Invalid multi-value separator ({field_name}): {value}\n"
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_unnecessary_separators(capsys):
|
||||||
|
"""Test checking unnecessary multi-value separators."""
|
||||||
|
|
||||||
|
field = "Alan||Orth||"
|
||||||
|
|
||||||
|
field_name = "dc.contributor.author"
|
||||||
|
|
||||||
|
check.separators(field, field_name)
|
||||||
|
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert captured.out == f"Unnecessary multi-value separator ({field_name}): {field}\n"
|
||||||
|
|
||||||
|
|
||||||
def test_check_valid_separators():
|
def test_check_valid_separators():
|
||||||
"""Test checking valid multi-value separators."""
|
"""Test checking valid multi-value separators."""
|
||||||
|
|
||||||
|
@ -41,6 +41,16 @@ def test_fix_invalid_separators():
|
|||||||
assert fix.separators(value, field_name) == "Alan||Orth"
|
assert fix.separators(value, field_name) == "Alan||Orth"
|
||||||
|
|
||||||
|
|
||||||
|
def test_fix_unnecessary_separators():
|
||||||
|
"""Test fixing unnecessary multi-value separators."""
|
||||||
|
|
||||||
|
field = "Alan||Orth||"
|
||||||
|
|
||||||
|
field_name = "dc.contributor.author"
|
||||||
|
|
||||||
|
assert fix.separators(field, field_name) == "Alan||Orth"
|
||||||
|
|
||||||
|
|
||||||
def test_fix_unnecessary_unicode():
|
def test_fix_unnecessary_unicode():
|
||||||
"""Test fixing unnecessary Unicode."""
|
"""Test fixing unnecessary Unicode."""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user