mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-25 23:28:18 +01:00
Update tests
This commit is contained in:
parent
0ed390dbd5
commit
456b8a2f26
@ -13,7 +13,7 @@ tasks:
|
|||||||
- testcli: |
|
- testcli: |
|
||||||
cd csv-metadata-quality
|
cd csv-metadata-quality
|
||||||
pipenv run pip install .
|
pipenv run pip install .
|
||||||
pipenv run csv-metadata-quality -i data/test.csv -o /tmp/test.csv -u
|
pipenv run csv-metadata-quality -i data/test.csv -o /tmp/test.csv -u --agrovoc-fields dc.subject,cg.coverage.country
|
||||||
environment:
|
environment:
|
||||||
PIPENV_NOSPIN: 'True'
|
PIPENV_NOSPIN: 'True'
|
||||||
PIPENV_HIDE_EMOJIS: 'True'
|
PIPENV_HIDE_EMOJIS: 'True'
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
dc.contributor.author,birthdate,dc.identifier.issn,dc.identifier.isbn,dc.language.iso,dc.subject
|
dc.contributor.author,birthdate,dc.identifier.issn,dc.identifier.isbn,dc.language.iso,dc.subject,cg.coverage.country
|
||||||
Leading space,2019-07-29,,,,
|
Leading space,2019-07-29,,,,,
|
||||||
Trailing space ,2019-07-29,,,,
|
Trailing space ,2019-07-29,,,,,
|
||||||
Excessive space,2019-07-29,,,,
|
Excessive space,2019-07-29,,,,,
|
||||||
Miscellaenous ||whitespace | issues ,2019-07-29,,,,
|
Miscellaenous ||whitespace | issues ,2019-07-29,,,,,
|
||||||
Duplicate||Duplicate,2019-07-29,,,,
|
Duplicate||Duplicate,2019-07-29,,,,,
|
||||||
Invalid ISSN,2019-07-29,2321-2302,,,
|
Invalid ISSN,2019-07-29,2321-2302,,,,
|
||||||
Invalid ISBN,2019-07-29,,978-0-306-40615-6,,
|
Invalid ISBN,2019-07-29,,978-0-306-40615-6,,,
|
||||||
Multiple valid ISSNs,2019-07-29,0378-5955||0024-9319,,,
|
Multiple valid ISSNs,2019-07-29,0378-5955||0024-9319,,,,
|
||||||
Multiple valid ISBNs,2019-07-29,,99921-58-10-7||978-0-306-40615-7,,
|
Multiple valid ISBNs,2019-07-29,,99921-58-10-7||978-0-306-40615-7,,,
|
||||||
Invalid date,2019-07-260,,,,
|
Invalid date,2019-07-260,,,,,
|
||||||
Multiple dates,2019-07-26||2019-01-10,,,,
|
Multiple dates,2019-07-26||2019-01-10,,,,,
|
||||||
Invalid multi-value separator,2019-07-29,0378-5955|0024-9319,,,
|
Invalid multi-value separator,2019-07-29,0378-5955|0024-9319,,,,
|
||||||
Unnecessary Unicode,2019-07-29,,,,
|
Unnecessary Unicode,2019-07-29,,,,,
|
||||||
Suspicious character||foreˆt,2019-07-29,,,,
|
Suspicious character||foreˆt,2019-07-29,,,,,
|
||||||
Invalid ISO 639-2 language,2019-07-29,,,jp,
|
Invalid ISO 639-2 language,2019-07-29,,,jp,,
|
||||||
Invalid ISO 639-3 language,2019-07-29,,,chi,
|
Invalid ISO 639-3 language,2019-07-29,,,chi,,
|
||||||
Invalid language,2019-07-29,,,Span,
|
Invalid language,2019-07-29,,,Span,,
|
||||||
Invalid AGROVOC subject,2019-07-29,,,,FOREST
|
Invalid AGROVOC subject,2019-07-29,,,,FOREST,
|
||||||
Newline (LF),2019-07-30,,,,"TANZA
|
Newline (LF),2019-07-30,,,,"TANZA
|
||||||
NIA"
|
NIA",
|
||||||
Missing date,,,,,
|
Missing date,,,,,,
|
||||||
|
Invalid country,2019-08-01,,,,,KENYAA
|
||||||
|
|
@ -175,18 +175,20 @@ def test_check_invalid_agrovoc(capsys):
|
|||||||
'''Test invalid AGROVOC subject.'''
|
'''Test invalid AGROVOC subject.'''
|
||||||
|
|
||||||
value = 'FOREST'
|
value = 'FOREST'
|
||||||
|
field_name = 'dc.subject'
|
||||||
|
|
||||||
check.agrovoc(value)
|
check.agrovoc(value, field_name)
|
||||||
|
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert captured.out == f'Invalid AGROVOC subject: {value}\n'
|
assert captured.out == f'Invalid AGROVOC ({field_name}): {value}\n'
|
||||||
|
|
||||||
|
|
||||||
def test_check_valid_agrovoc():
|
def test_check_valid_agrovoc():
|
||||||
'''Test valid AGROVOC subject.'''
|
'''Test valid AGROVOC subject.'''
|
||||||
|
|
||||||
value = 'FORESTS'
|
value = 'FORESTS'
|
||||||
|
field_name = 'dc.subject'
|
||||||
|
|
||||||
result = check.agrovoc(value)
|
result = check.agrovoc(value, field_name)
|
||||||
|
|
||||||
assert result == value
|
assert result == value
|
||||||
|
Loading…
Reference in New Issue
Block a user