From: Karl O. Pinc Date: Fri, 30 Apr 2021 01:27:09 +0000 (-0500) Subject: Test validate_file_format() X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=3929b0729cec78c9b89cf2b918a50e4bc956efa3;p=pgwui_upload_core Test validate_file_format() --- diff --git a/tests/test_check_settings.py b/tests/test_check_settings.py index 39c5036..fc413e1 100644 --- a/tests/test_check_settings.py +++ b/tests/test_check_settings.py @@ -45,6 +45,24 @@ mock_boolean_choice = testing.make_mock_fixture( checkset, 'boolean_choice') +# validate_file_format() + +@pytest.mark.parametrize( + ('setting', 'error_cnt'), [ + ('csv', 0), + ('tab', 0), + ('invalid', 1)]) +@pytest.mark.unittest +def test_validate_file_format(setting, error_cnt): + '''Returns the expected number of errors + ''' + errors = [] + settings = {'file_format': setting} + check_settings.validate_file_format(None, errors, settings) + + assert len(errors) == error_cnt + + # check_settings() @pytest.mark.unittest