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:
@ -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'
|
||||
|
Reference in New Issue
Block a user