(self)
| 82 | |
| 83 | class TestCollectGitContext(unittest.TestCase): |
| 84 | def test_git_repo(self): |
| 85 | clear_git_caches() |
| 86 | with tempfile.TemporaryDirectory() as tmp: |
| 87 | _init_git_repo(tmp) |
| 88 | ctx = _run(collect_git_context(tmp)) |
| 89 | self.assertTrue(ctx.available) |
| 90 | self.assertIsNotNone(ctx.branch) |
| 91 | self.assertIsNotNone(ctx.default_branch) |
| 92 | self.assertIsNotNone(ctx.user_name) |
| 93 | self.assertEqual(ctx.user_name, "Test User") |
| 94 | self.assertIsNotNone(ctx.recent_commits) |
| 95 | self.assertIn("Initial commit", ctx.recent_commits) |
| 96 | clear_git_caches() |
| 97 | |
| 98 | def test_non_git_dir(self): |
| 99 | clear_git_caches() |
nothing calls this directly
no test coverage detected