1
0
Fork 0

Adding upstream version 1.4.13.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-12 16:43:50 +01:00
parent afaf4643e1
commit 03367abfa8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
25 changed files with 7987 additions and 0 deletions

33
tests/cli_test.py Normal file
View file

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from identify import cli
def test_identify_cli(capsys):
ret = cli.main(('setup.py',))
out, _ = capsys.readouterr()
assert ret == 0
assert out == '["file", "non-executable", "python", "text"]\n'
def test_identify_cli_filename_only(capsys):
ret = cli.main(('setup.py', '--filename-only'))
out, _ = capsys.readouterr()
assert ret == 0
assert out == '["python", "text"]\n'
def test_identify_cli_filename_only_unidentified(capsys):
ret = cli.main(('x.unknown', '--filename-only'))
out, _ = capsys.readouterr()
assert ret == 1
assert out == ''
def test_file_not_found(capsys):
ret = cli.main(('x.unknown',))
out, _ = capsys.readouterr()
assert ret == 1
assert out == 'x.unknown does not exist.\n'