Skip to content

Commit

Permalink
Add additional assertions to test_base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Sineaggi committed Feb 2, 2023
1 parent bc8f119 commit fb6eb3d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import tempfile
from unittest import SkipTest, skipIf

from git import Repo
from git.objects import Blob, Tree, Commit, TagObject
from git.compat import is_win
from git.objects.util import get_object_type_by_name
Expand Down Expand Up @@ -95,15 +96,18 @@ def test_object_resolution(self):
self.assertEqual(self.rorepo.head.reference.object, self.rorepo.active_branch.object)

@with_rw_repo("HEAD", bare=True)
def test_with_bare_rw_repo(self, bare_rw_repo):
def test_with_bare_rw_repo(self, bare_rw_repo: Repo):
assert bare_rw_repo.config_reader("repository").getboolean("core", "bare")
assert osp.isfile(osp.join(bare_rw_repo.git_dir, "HEAD"))
assert osp.isdir(bare_rw_repo.working_dir)
assert bare_rw_repo.working_tree_dir is None

@with_rw_repo("0.1.6")
def test_with_rw_repo(self, rw_repo):
def test_with_rw_repo(self, rw_repo: Repo):
assert not rw_repo.config_reader("repository").getboolean("core", "bare")
assert osp.isdir(rw_repo.working_tree_dir)
assert osp.isdir(osp.join(rw_repo.working_tree_dir, "lib"))
assert osp.isdir(rw_repo.working_dir)

@skipIf(HIDE_WINDOWS_FREEZE_ERRORS, "FIXME: Freezes! sometimes...")
@with_rw_and_rw_remote_repo("0.1.6")
Expand Down

0 comments on commit fb6eb3d

Please sign in to comment.