1
0
Fork 0

Adding upstream version 2.9.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:22:51 +01:00
parent e8d3ba475e
commit 5f54aad01b
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
32 changed files with 252 additions and 75 deletions

View file

@ -219,6 +219,19 @@ def test_types_hook_repository(cap_out, store, tempdir_factory):
assert b'bar.notpy' not in printed
def test_types_or_hook_repository(cap_out, store, tempdir_factory):
git_path = make_consuming_repo(tempdir_factory, 'types_or_repo')
with cwd(git_path):
stage_a_file('bar.notpy')
stage_a_file('bar.pxd')
stage_a_file('bar.py')
ret, printed = _do_run(cap_out, store, git_path, run_opts())
assert ret == 1
assert b'bar.notpy' not in printed
assert b'bar.pxd' in printed
assert b'bar.py' in printed
def test_exclude_types_hook_repository(cap_out, store, tempdir_factory):
git_path = make_consuming_repo(tempdir_factory, 'exclude_types_repo')
with cwd(git_path):
@ -951,6 +964,27 @@ def test_classifier_does_not_normalize_backslashes_non_windows(tmpdir):
assert classifier.filenames == [r'a/b\c']
def test_classifier_empty_types_or(tmpdir):
tmpdir.join('bar').ensure()
os.symlink(tmpdir.join('bar'), tmpdir.join('foo'))
with tmpdir.as_cwd():
classifier = Classifier(('foo', 'bar'))
for_symlink = classifier.by_types(
classifier.filenames,
types=['symlink'],
types_or=[],
exclude_types=[],
)
for_file = classifier.by_types(
classifier.filenames,
types=['file'],
types_or=[],
exclude_types=[],
)
assert for_symlink == ['foo']
assert for_file == ['bar']
@pytest.fixture
def some_filenames():
return (