def test_update_repo_should_throw_for_no_default_branch_or_name(self): with self.assertRaises(Exception) as exc: response = update_repo(repository='sample repo id', organization=self._TEST_DEVOPS_ORGANIZATION, project='sample project') self.assertEqual( str(exc.exception), r'Either --default-branch or --name (for rename) must be provided to update repository.' )
def test_update_repo_should_call_update_api(self): response = update_repo(repository='sample repo id', organization=self._TEST_DEVOPS_ORGANIZATION, project='sample project', name="new repo name", default_branch="live") #assert self.mock_get_repository.assert_called_once() self.mock_update_repository.assert_called_once()