def test_constructor(self): r1 = Repo.init(self.path, mkdir=True) # verify that an existing repository can be initialized r2 = Repo(r1.root) # make sure it's a Repo object. assert type(r2) is Repo # a new repo should have no HEAD try: r2.head() except NoHeadSet: pass