1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2025-05-09 06:36:00 +02:00

Add "unsafe fixes" runtime option

In this case it fixes occurences of invalid multi-value separators.
DSpace uses "||" to separate multiple values in one field, but our
editors sometimes give us files with mistakes like "|". We can fix
these to be correct multi-value separators if we are sure that the
metadata is not actually using "|" for some legitimate purpose.
This commit is contained in:
2019-07-28 22:53:39 +03:00
parent a93b5b31c5
commit 40e77db713
4 changed files with 46 additions and 1 deletions

View File

@ -23,3 +23,11 @@ def test_fix_excessive_whitespace():
value = 'Alan Orth'
assert fix.whitespace(value) == 'Alan Orth'
def test_fix_invalid_separators():
'''Test fixing invalid multi-value separators.'''
value = 'Alan|Orth'
assert fix.separators(value) == 'Alan||Orth'