(fp, tmp_path)
| 116 | |
| 117 | |
| 118 | def test_initialize_creates_initial_commit(fp, tmp_path): |
| 119 | fp.register(["git", "--version"], stdout="git version 2.30.0\n") |
| 120 | fp.register(["git", "init"], stdout="") |
| 121 | fp.register(["git", "--version"], stdout="git version 2.30.0\n") |
| 122 | fp.register(["git", "rev-parse", "--is-inside-work-tree"], stdout="true\n") |
| 123 | fp.register(["git", "rev-parse", "--verify", "HEAD"], returncode=1) |
| 124 | fp.register(["git", "add", "."], stdout="") |
| 125 | fp.register( |
| 126 | [ |
| 127 | "git", |
| 128 | "-c", |
| 129 | "user.name=CrewAI", |
| 130 | "-c", |
| 131 | "user.email=deploy@crewai.com", |
| 132 | "commit", |
| 133 | "--allow-empty", |
| 134 | "-m", |
| 135 | "Initial crew", |
| 136 | ], |
| 137 | stdout="", |
| 138 | ) |
| 139 | |
| 140 | repo = Repository.initialize(path=str(tmp_path)) |
| 141 | |
| 142 | assert repo.path == str(tmp_path) |
| 143 | exclude_file = tmp_path / ".git" / "info" / "exclude" |
| 144 | exclude_text = exclude_file.read_text() |
| 145 | assert ".env" in exclude_text |
| 146 | assert "!.env.example" in exclude_text |
| 147 | assert "!.env.sample" in exclude_text |
| 148 | assert "__pycache__/" in exclude_text |
| 149 | |
| 150 | |
| 151 | def test_deployable_files_uses_git_excludes(fp, repository): |
nothing calls this directly
no test coverage detected