MCPcopy
hub / github.com/GitGuardian/ggshield / test_gitignore

Function test_gitignore

tests/unit/utils/test_git_shell.py:715–726  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

713
714
715def test_gitignore(tmp_path):
716 # GIVEN a repository
717 repo = Repository.create(tmp_path)
718 repo.create_commit()
719
720 # WHEN adding a path to the gitignore
721 with cd(str(repo.path)):
722 gitignore(Path("*.pyc"))
723
724 # THEN the path is added to the gitignore file
725 gitignore_content = (repo.path / ".gitignore").read_text()
726 assert "\n*.pyc\n" in gitignore_content
727
728
729def test_gitignore_with_existing_gitignore(tmp_path):

Callers

nothing calls this directly

Calls 4

cdFunction · 0.90
gitignoreFunction · 0.90
create_commitMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected