Skip to content

Commit

Permalink
Add a test for deleting artifacts (PyGithub#2313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksei Fedotov authored and sfdye committed Oct 25, 2022
1 parent 720dbe2 commit c333a99
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Artifact.py
Expand Up @@ -40,3 +40,12 @@ def testGetArtifactsFromRepo(self):
repr(artifact),
f'Artifact(name="vscode-codeql-extension", id={artifact_id})',
)

def testDelete(self):
artifact_id = 396724439
repo_name = "lexa/PyGithub"
repo = self.g.get_repo(repo_name)
artifact = repo.get_artifact(artifact_id)
self.assertTrue(artifact.delete())
with self.assertRaises(github.GithubException):
repo.get_artifact(artifact_id)

0 comments on commit c333a99

Please sign in to comment.