mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-26 15:48:19 +01:00
tests/test_check.py: add missing excludes
This commit is contained in:
parent
566c2b45cf
commit
f64435fc9d
@ -257,12 +257,13 @@ def test_check_incorrect_iso_639_1_language(capsys):
|
|||||||
|
|
||||||
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
||||||
language = "es"
|
language = "es"
|
||||||
|
exclude = list()
|
||||||
|
|
||||||
# Create a dictionary to mimic Pandas series
|
# Create a dictionary to mimic Pandas series
|
||||||
row = {"dc.title": title, "dc.language.iso": language}
|
row = {"dc.title": title, "dc.language.iso": language}
|
||||||
series = pd.Series(row)
|
series = pd.Series(row)
|
||||||
|
|
||||||
experimental.correct_language(series)
|
experimental.correct_language(series, exclude)
|
||||||
|
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert (
|
assert (
|
||||||
@ -276,12 +277,13 @@ def test_check_incorrect_iso_639_3_language(capsys):
|
|||||||
|
|
||||||
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
||||||
language = "spa"
|
language = "spa"
|
||||||
|
exclude = list()
|
||||||
|
|
||||||
# Create a dictionary to mimic Pandas series
|
# Create a dictionary to mimic Pandas series
|
||||||
row = {"dc.title": title, "dc.language.iso": language}
|
row = {"dc.title": title, "dc.language.iso": language}
|
||||||
series = pd.Series(row)
|
series = pd.Series(row)
|
||||||
|
|
||||||
experimental.correct_language(series)
|
experimental.correct_language(series, exclude)
|
||||||
|
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert (
|
assert (
|
||||||
@ -295,12 +297,13 @@ def test_check_correct_iso_639_1_language():
|
|||||||
|
|
||||||
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
||||||
language = "en"
|
language = "en"
|
||||||
|
exclude = list()
|
||||||
|
|
||||||
# Create a dictionary to mimic Pandas series
|
# Create a dictionary to mimic Pandas series
|
||||||
row = {"dc.title": title, "dc.language.iso": language}
|
row = {"dc.title": title, "dc.language.iso": language}
|
||||||
series = pd.Series(row)
|
series = pd.Series(row)
|
||||||
|
|
||||||
result = experimental.correct_language(series)
|
result = experimental.correct_language(series, exclude)
|
||||||
|
|
||||||
assert result == None
|
assert result == None
|
||||||
|
|
||||||
@ -310,12 +313,13 @@ def test_check_correct_iso_639_3_language():
|
|||||||
|
|
||||||
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
|
||||||
language = "eng"
|
language = "eng"
|
||||||
|
exclude = list()
|
||||||
|
|
||||||
# Create a dictionary to mimic Pandas series
|
# Create a dictionary to mimic Pandas series
|
||||||
row = {"dc.title": title, "dc.language.iso": language}
|
row = {"dc.title": title, "dc.language.iso": language}
|
||||||
series = pd.Series(row)
|
series = pd.Series(row)
|
||||||
|
|
||||||
result = experimental.correct_language(series)
|
result = experimental.correct_language(series, exclude)
|
||||||
|
|
||||||
assert result == None
|
assert result == None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user