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

tests/test_check.py: Add tests for file extensions

This commit is contained in:
Alan Orth 2019-08-10 23:44:13 +03:00
parent 9ce7dc6716
commit 62ef2a4489
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -194,3 +194,24 @@ def test_check_valid_agrovoc():
result = check.agrovoc(value, field_name)
assert result == value
def test_check_uncommon_filename_extension(capsys):
'''Test uncommon filename extension.'''
value = 'file.pdf.lck'
result = check.filename_extension(value)
captured = capsys.readouterr()
assert captured.out == f'Filename with uncommon extension: {value}\n'
def test_check_common_filename_extension():
'''Test common filename extension.'''
value = 'file.pdf'
result = check.filename_extension(value)
assert result == value