diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-03-24 23:10:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-03-24 23:10:43 +0000 |
commit | 4bbf6c088551d74da917b0ad9c1e83366afa9a50 (patch) | |
tree | e50dbe6b1d31c17ef7129d50c6bc5480c5539690 /tests/extensions_test.py | |
parent | Initial commit. (diff) | |
download | identify-4bbf6c088551d74da917b0ad9c1e83366afa9a50.tar.xz identify-4bbf6c088551d74da917b0ad9c1e83366afa9a50.zip |
Adding upstream version 1.4.13.upstream/1.4.13
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/extensions_test.py')
-rw-r--r-- | tests/extensions_test.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/extensions_test.py b/tests/extensions_test.py new file mode 100644 index 0000000..44f16a8 --- /dev/null +++ b/tests/extensions_test.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import +from __future__ import unicode_literals + +import pytest + +from identify import extensions + + +@pytest.mark.parametrize('extension', extensions.EXTENSIONS) +def test_extensions_have_binary_or_text(extension): + tags = extensions.EXTENSIONS[extension] + assert len({'text', 'binary'} & tags) == 1, tags + + +@pytest.mark.parametrize('extension', extensions.EXTENSIONS_NEED_BINARY_CHECK) +def test_need_binary_check_do_not_specify_text_binary(extension): + tags = extensions.EXTENSIONS_NEED_BINARY_CHECK[extension] + assert len({'text', 'binary'} & tags) == 0, tags + + +def test_mutually_exclusive_check_types(): + assert not ( + set(extensions.EXTENSIONS) & + set(extensions.EXTENSIONS_NEED_BINARY_CHECK) + ) |