Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relative hidden directory and basic subdir tests #2542

Merged
merged 5 commits into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions codespell_lib/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,23 @@ def test_check_hidden(tmpdir, capsys):
assert cs.main(d) == 0
assert cs.main('--check-hidden', d) == 2
assert cs.main('--check-hidden', '--check-filenames', d) == 5
# check again with a relative path
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) == 3
assert cs.main('--check-hidden', '--check-filenames', d) == 8


def test_case_handling(tmpdir, capsys):
Expand Down