def test_branch(self): """Test creation of a repository object with a branch """ name = 'test_repo' protocol = 'test_protocol' url = 'test_url' branch = 'test_branch' repo_info = { ExternalsDescription.PROTOCOL: protocol, ExternalsDescription.REPO_URL: url, ExternalsDescription.BRANCH: branch, ExternalsDescription.TAG: EMPTY_STR, } repo = Repository(name, repo_info) print(repo.__dict__) self.assertEqual(repo.branch(), branch) self.assertEqual(repo.url(), url)
def test_tag(self): """Test creation of a repository object with a tag """ name = 'test_repo' protocol = 'test_protocol' url = 'test_url' tag = 'test_tag' repo_info = { ExternalsDescription.PROTOCOL: protocol, ExternalsDescription.REPO_URL: url, ExternalsDescription.TAG: tag, ExternalsDescription.BRANCH: EMPTY_STR, } repo = Repository(name, repo_info) print(repo.__dict__) self.assertEqual(repo.tag(), tag) self.assertEqual(repo.url(), url)
def test_hash(self): """Test creation of a repository object with a hash """ name = 'test_repo' protocol = 'test_protocol' url = 'test_url' ref = 'deadc0de' repo_info = { ExternalsDescription.PROTOCOL: protocol, ExternalsDescription.REPO_URL: url, ExternalsDescription.BRANCH: EMPTY_STR, ExternalsDescription.TAG: EMPTY_STR, ExternalsDescription.HASH: ref, } repo = Repository(name, repo_info) print(repo.__dict__) self.assertEqual(repo.hash(), ref) self.assertEqual(repo.url(), url)