mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-22 22:05:03 +01:00
Alan Orth
41a30f1b07
For now only test fixes because they return changed data. I'm not sure how to test the checks, because they don't return data and I can't modify them to return boolean values without breaking the app.
24 lines
498 B
Python
24 lines
498 B
Python
import csv_metadata_quality.fix as fix
|
|
import pytest
|
|
|
|
def test_fix_leading_whitespace():
|
|
'''Test fixing leading whitespace.'''
|
|
|
|
value = ' Alan'
|
|
|
|
assert fix.whitespace(value) == 'Alan'
|
|
|
|
def test_fix_trailing_whitespace():
|
|
'''Test fixing trailing whitespace.'''
|
|
|
|
value = 'Alan '
|
|
|
|
assert fix.whitespace(value) == 'Alan'
|
|
|
|
def test_fix_excessive_whitespace():
|
|
'''Test fixing excessive whitespace.'''
|
|
|
|
value = 'Alan Orth'
|
|
|
|
assert fix.whitespace(value) == 'Alan Orth'
|