1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2024-12-22 12:12:18 +01:00

Fix whitespace errors found by flake8

This commit is contained in:
Alan Orth 2019-07-28 17:47:28 +03:00
parent c6e7d6d9b5
commit 87b1997051
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
4 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,6 @@
import pandas as pd
def issn(field):
"""Check if an ISSN is valid.
@ -71,7 +72,6 @@ def separators(field):
if len(match) > 0:
print(f'Invalid multi-value separator: {field}')
return field

View File

@ -1,6 +1,7 @@
import pandas as pd
import re
def whitespace(field):
"""Fix whitespace issues.
@ -34,4 +35,3 @@ def whitespace(field):
new_field = '||'.join(values)
return new_field

View File

@ -1,12 +1,13 @@
import csv_metadata_quality.check as check
def test_check_invalid_issn(capsys):
'''Test checking invalid ISSN.'''
value = '2321-2302'
check.issn(value)
captured = capsys.readouterr()
assert captured.out == f'Invalid ISSN: {value}\n'

View File

@ -1,5 +1,6 @@
import csv_metadata_quality.fix as fix
def test_fix_leading_whitespace():
'''Test fixing leading whitespace.'''
@ -7,6 +8,7 @@ def test_fix_leading_whitespace():
assert fix.whitespace(value) == 'Alan'
def test_fix_trailing_whitespace():
'''Test fixing trailing whitespace.'''
@ -14,6 +16,7 @@ def test_fix_trailing_whitespace():
assert fix.whitespace(value) == 'Alan'
def test_fix_excessive_whitespace():
'''Test fixing excessive whitespace.'''