Skip to content

Commit

Permalink
test_gitignore_parser: format per ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Javagedes committed Oct 1, 2024
1 parent a406849 commit 53f7000
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests.unit/parsers/test_gitingore_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,18 @@ def test_incomplete_filename(tmp_path):
assert rule_tester("/home/tmp/dir/o.pyc") is False



def test_unrelated_path(tmp_path):
"""Tests that a path that is completely unrelated to another path works."""
root = tmp_path.resolve()
gitignore_path = root / ".gitignore"

with open(gitignore_path, 'w') as f:
f.write('*foo*\n')
with open(gitignore_path, "w") as f:
f.write("*foo*\n")

rule_tester = gitignore_parser.parse_gitignore_file(gitignore_path, base_dir='/home/tmp')
rule_tester = gitignore_parser.parse_gitignore_file(gitignore_path, base_dir="/home/tmp")

assert rule_tester('/home/tmp/foo') is True
assert rule_tester('/some/other/dir') is False
assert rule_tester("/home/tmp/foo") is True
assert rule_tester("/some/other/dir") is False


def test_double_asterisks(tmp_path):
Expand Down

0 comments on commit 53f7000

Please sign in to comment.