From 62ef2a4489820d7d6295ce4e282a2d81d905e39e Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sat, 10 Aug 2019 23:44:13 +0300 Subject: [PATCH] tests/test_check.py: Add tests for file extensions --- tests/test_check.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_check.py b/tests/test_check.py index 7bb5331..1faef1d 100644 --- a/tests/test_check.py +++ b/tests/test_check.py @@ -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