# Path: github/GithubException.py
# class GithubException(Exception):
#     """
#     Error handling in PyGithub is done with exceptions. This class is the base of all exceptions raised by PyGithub (but :class:`github.GithubException.BadAttributeException`).
# 
#     Some other types of exceptions might be raised by underlying libraries, for example for network-related issues.
#     """
# 
#     def __init__(self, status, data, headers):
#         super().__init__()
#         self.__status = status
#         self.__data = data
#         self.__headers = headers
#         self.args = [status, data, headers]
# 
#     @property
#     def status(self):
#         """
#         The status returned by the Github API
#         """
#         return self.__status
# 
#     @property
#     def data(self):
#         """
#         The (decoded) data returned by the Github API
#         """
#         return self.__data
# 
#     @property
#     def headers(self):
#         """
#         The headers returned by the Github API
#         """
#         return self.__headers
# 
#     def __str__(self):
#         return "{status} {data}".format(status=self.status, data=json.dumps(self.data))


import datetime
import os
import zipfile
from github import GithubException
from . import Framework
        artifact.write(self.content_path)
        artifact.close()
        self.repo = self.g.get_user(user).get_repo(repo_name)
        self.release = self.repo.get_release(release_id)

    def tearDown(self):
        if os.path.exists(self.content_path):
            os.remove(self.content_path)
        if os.path.exists(self.artifact_path):
            os.remove(self.artifact_path)

        super().tearDown()

    def setUpNewRelease(self):
        repo = self.repo
        commit_sha = repo.get_commits()[0].sha  # Just need any commit
        self.new_release = repo.create_git_tag_and_release(
            self.new_tag,
            "tag message",
            "release title",
            "release message",
            commit_sha,
            "commit",
        )
        self.new_release_id = self.new_release.id

    def tearDownNewRelease(self):
        try:
            new_release = self.repo.get_release(self.new_release_id)
            new_release.delete_release()

# Path: github/GithubException.py
# class GithubException(Exception):
#     """
#     Error handling in PyGithub is done with exceptions. This class is the base of all exceptions raised by PyGithub (but :class:`github.GithubException.BadAttributeException`).
# 
#     Some other types of exceptions might be raised by underlying libraries, for example for network-related issues.
#     """
# 
#     def __init__(self, status, data, headers):
#         super().__init__()
#         self.__status = status
#         self.__data = data
#         self.__headers = headers
#         self.args = [status, data, headers]
# 
#     @property
#     def status(self):
#         """
#         The status returned by the Github API
#         """
#         return self.__status
# 
#     @property
#     def data(self):
#         """
#         The (decoded) data returned by the Github API
#         """
#         return self.__data
# 
#     @property
#     def headers(self):
#         """
#         The headers returned by the Github API
#         """
#         return self.__headers
# 
#     def __str__(self):
#         return "{status} {data}".format(status=self.status, data=json.dumps(self.data))


# Path: tests/GitRelease.py
import datetime
import os
import zipfile
from github import GithubException
from . import Framework

        artifact.write(self.content_path)
        artifact.close()
        self.repo = self.g.get_user(user).get_repo(repo_name)
        self.release = self.repo.get_release(release_id)

    def tearDown(self):
        if os.path.exists(self.content_path):
            os.remove(self.content_path)
        if os.path.exists(self.artifact_path):
            os.remove(self.artifact_path)

        super().tearDown()

    def setUpNewRelease(self):
        repo = self.repo
        commit_sha = repo.get_commits()[0].sha  # Just need any commit
        self.new_release = repo.create_git_tag_and_release(
            self.new_tag,
            "tag message",
            "release title",
            "release message",
            commit_sha,
            "commit",
        )
        self.new_release_id = self.new_release.id

    def tearDownNewRelease(self):
        try:
            new_release = self.repo.get_release(self.new_release_id)
            new_release.delete_release()

        except GithubException: