1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2025-05-10 15:16:01 +02:00

Reformat tests with black

This commit is contained in:
2019-09-26 14:02:51 +03:00
parent e7c220039b
commit 604bd5bda6
2 changed files with 108 additions and 102 deletions

View File

@ -2,67 +2,67 @@ import csv_metadata_quality.fix as fix
def test_fix_leading_whitespace():
'''Test fixing leading whitespace.'''
"""Test fixing leading whitespace."""
value = ' Alan'
value = " Alan"
assert fix.whitespace(value) == 'Alan'
assert fix.whitespace(value) == "Alan"
def test_fix_trailing_whitespace():
'''Test fixing trailing whitespace.'''
"""Test fixing trailing whitespace."""
value = 'Alan '
value = "Alan "
assert fix.whitespace(value) == 'Alan'
assert fix.whitespace(value) == "Alan"
def test_fix_excessive_whitespace():
'''Test fixing excessive whitespace.'''
"""Test fixing excessive whitespace."""
value = 'Alan Orth'
value = "Alan Orth"
assert fix.whitespace(value) == 'Alan Orth'
assert fix.whitespace(value) == "Alan Orth"
def test_fix_invalid_separators():
'''Test fixing invalid multi-value separators.'''
"""Test fixing invalid multi-value separators."""
value = 'Alan|Orth'
value = "Alan|Orth"
assert fix.separators(value) == 'Alan||Orth'
assert fix.separators(value) == "Alan||Orth"
def test_fix_unnecessary_unicode():
'''Test fixing unnecessary Unicode.'''
"""Test fixing unnecessary Unicode."""
value = 'Alan Orth'
value = "Alan Orth"
assert fix.unnecessary_unicode(value) == 'Alan Orth'
assert fix.unnecessary_unicode(value) == "Alan Orth"
def test_fix_duplicates():
'''Test fixing duplicate metadata values.'''
"""Test fixing duplicate metadata values."""
value = 'Kenya||Kenya'
value = "Kenya||Kenya"
assert fix.duplicates(value) == 'Kenya'
assert fix.duplicates(value) == "Kenya"
def test_fix_newlines():
'''Test fixing newlines.'''
"""Test fixing newlines."""
value = '''Ken
ya'''
value = """Ken
ya"""
assert fix.newlines(value) == 'Kenya'
assert fix.newlines(value) == "Kenya"
def test_fix_comma_space():
'''Test adding space after comma.'''
"""Test adding space after comma."""
value = 'Orth,Alan S.'
value = "Orth,Alan S."
field_name = 'dc.contributor.author'
field_name = "dc.contributor.author"
assert fix.comma_space(value, field_name) == 'Orth, Alan S.'
assert fix.comma_space(value, field_name) == "Orth, Alan S."