Skip to content

Commit

Permalink
Test a hidden subdirectory too
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewman authored and DimitriPapadopoulos committed Oct 20, 2022
1 parent 04f93cf commit 9c5c6ec
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion codespell_lib/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,22 @@ def test_check_hidden(tmpdir, capsys):
assert cs.main('--check-hidden', d) == 2
assert cs.main('--check-hidden', '--check-filenames', d) == 5
# check again with a relative path
rel = op.join('.', str(tmpdir))
rel = op.relpath(tmpdir)
assert cs.main(rel) == 0
assert cs.main('--check-hidden', rel) == 2
assert cs.main('--check-hidden', '--check-filenames', rel) == 5
# hidden subdirectory
assert cs.main(d) == 0
assert cs.main('--check-hidden', d) == 2
assert cs.main('--check-hidden', '--check-filenames', d) == 5
subdir = op.join(d, 'subdir')
os.mkdir(subdir)
os.mkdir(op.join(subdir, '.abandonned'))
copyfile(op.join(d, '.abandonned.txt'),
op.join(subdir, '.abandonned', 'abandonned.txt'))
assert cs.main(d) == 0
assert cs.main('--check-hidden', d) == 4
assert cs.main('--check-hidden', '--check-filenames', d) == 10


def test_case_handling(tmpdir, capsys):
Expand Down

0 comments on commit 9c5c6ec

Please sign in to comment.