desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'Test the ability to create a milestone on a repository.'
def test_create_milestone(self):
self.token_login() cassette_name = self.cassette_name('create_milestone') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') milestone = repository.create_milestone('foo') assert isinstance(milestone, github3.issues.milestone.Mil...
'Test the ability to create a pull request on a repository.'
def test_create_pull(self):
self.token_login() cassette_name = self.cassette_name('create_pull') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') pull_request = repository.create_pull(title='Migrate some test cases from test_repo_repo', base='d...
'Test the ability to create a pull request from an issue on a repository.'
def test_create_pull_from_issue(self):
self.token_login() cassette_name = self.cassette_name('create_pull_from_issue') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') pull_request = repository.create_pull_from_issue(issue=536, base='develop', head='itsmemattchung:tests...
'Test the ability to create a release on a repository.'
def test_create_release(self):
self.token_login() cassette_name = self.cassette_name('create_release') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'charade') assert (repository is not None) release = repository.create_release('1.0.3.test', 'f1d4e150be7070adfbbdca...
'Test the ability to create a status object on a commit.'
def test_create_status(self):
self.token_login() cassette_name = self.cassette_name('create_status') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') status = repository.create_status(sha='24893ec07db2a12073703258f0089f105906d2e4', state='failure') assert...
'Test the ability to create an annotated tag on a repository.'
def test_create_tag(self):
self.basic_login() cassette_name = self.cassette_name('create_tag') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'fork_this') assert (repository is not None) tag = repository.create_tag(tag='tag-name', message='Test annotated tag ...
'Test that a repository can be deleted.'
def test_delete(self):
self.basic_login() cassette_name = self.cassette_name('delete') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'my-new-repo') assert (repository is not None) assert (repository.delete() is True)
'Test the ability to delete a key from a repository.'
def test_delete_key(self):
self.token_login() cassette_name = self.cassette_name('delete_key') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') assert (repository.delete_key(15312662) is True)
'Test the ability to delete a subscription from a repository.'
def test_delete_subscription(self):
self.token_login() cassette_name = self.cassette_name('delete_subscription') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository.delete_subscription() is True)
'Test that a deployment can be retrieved by its id.'
def test_deployment(self):
cassette_name = self.cassette_name('deployment') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) deployment = repository.deployment(797) assert isinstance(deployment, github3.repos.deploymen...
'Test that a repository\'s deployments may be retrieved.'
def test_deployments(self):
cassette_name = self.cassette_name('deployments') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) for d in repository.deployments(): assert isinstance(d, github3.repos.deployment.Dep...
'Test that a directory\'s contents can be retrieved.'
@pytest.mark.xfail((requests.__build__ >= 135424), reason='Requests breaks our recorded cassettes') def test_directory_contents(self):
cassette_name = self.cassette_name('directory_contents') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') contents = repository.directory_contents('github3/search/') for (filename, content) in contents: assert (content.name...
'Test the ability to edit a repository.'
def test_edit(self):
self.token_login() cassette_name = self.cassette_name('edit') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') assert (repository.edit('github3py') is True)
'Test that a user can iterate over the events from a repository.'
def test_events(self):
cassette_name = self.cassette_name('events') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) events = list(repository.events(number=100)) assert (len(events) > 0) for event in events: ...
'Test that a file\'s contents can be retrieved.'
def test_file_contents(self):
cassette_name = self.cassette_name('file_contents') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') contents = repository.file_contents('github3/repos/repo.py') assert isinstance(contents, github3.repos.contents.Contents) asse...
'Test that a user can iterate over the forks of a repository.'
def test_forks(self):
cassette_name = self.cassette_name('forks') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) forks = list(repository.forks()) assert (len(forks) > 0) for fork in forks: assert isi...
'Test the ability to retrieve a commit from a repository.'
def test_git_commit(self):
cassette_name = self.cassette_name('git_commit') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') commit = repository.git_commit('9ea7482560c9e70c66019f7981aa1727caf888e0') assert isinstance(commit, github3.git.Commit)
'Test the ability to retrieve a hook from a repository.'
def test_hook(self):
self.token_login() cassette_name = self.cassette_name('hook') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') hook = repository.hook(6818702) assert isinstance(hook, github3.repos.hook.Hook)
'Test that a user can iterate over the hooks of a repository.'
def test_hooks(self):
self.basic_login() cassette_name = self.cassette_name('hooks') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) hooks = list(repository.hooks()) assert (len(hooks) > 0) for hook in ho...
'Test that a user can ignore the notifications on a repository.'
def test_ignore(self):
self.basic_login() cassette_name = self.cassette_name('ignore') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('jnewland', 'gmond_python_modules') assert (repository is not None) subscription = repository.ignore() assert (subscription.ignored ...
'Test the ability to check if a user can be assigned issues on a repository.'
def test_is_assignee(self):
cassette_name = self.cassette_name('is_assignee') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') is_assignee = repository.is_assignee('itsmemattchung') assert (is_assignee is True)
'Test the ability to check if a user is a collaborator on a repository.'
def test_is_collaborator(self):
self.token_login() cassette_name = self.cassette_name('is_collaborator') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository.is_collaborator('itsmemattchung') is True)
'Test the ability to retrieve an issue from a repository.'
def test_issue(self):
cassette_name = self.cassette_name('issue') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') issue = repository.issue(525) assert isinstance(issue, github3.issues.issue.Issue)
'Test the ability to retrieve an issue from a repository.'
def test_issue_with_multiple_assignees(self):
cassette_name = self.cassette_name('issue_multiple_assignees') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') issue = repository.issue(637) assert isinstance(issue, github3.issues.issue.Issue) assert isinstance(issue.assignee...
'Test the ability to retrieve an imported issue by id.'
def test_imported_issue(self):
self.token_login() cassette_name = self.cassette_name('imported_issue') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'test_rename1') imported_issue = repository.imported_issue(399790) assert isinstance(imported_issue, github3.repos.issue_im...
'Test the ability to retrieve imported issues.'
def test_imported_issues(self):
self.token_login() cassette_name = self.cassette_name('imported_issues') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'test_rename1') imported_issues = list(repository.imported_issues()) assert (len(imported_issues) > 0) for imported_is...
'Test the ability to import an issue.'
def test_import_issue(self):
self.token_login() cassette_name = self.cassette_name('import_issue') with self.recorder.use_cassette(cassette_name): issue = {'title': 'foo', 'body': 'bar', 'created_at': '2014-03-16T17:15:42Z'} repository = self.gh.repository('github3py', 'test_rename1') imported_issue = repository...
'Test the ability to import an issue with comments on a repoitory.'
def test_import_issue_with_comments(self):
self.token_login() cassette_name = self.cassette_name('import_issue_with_comments') with self.recorder.use_cassette(cassette_name): issue = {'title': 'foo', 'body': 'bar', 'created_at': '2014-03-16T17:15:42Z', 'comments': [{'body': 'fake comments'}]} repository = self.gh.repository('githu...
'Test that a user can iterate over issue events in a repo.'
def test_issue_events(self):
cassette_name = self.cassette_name('issue_events') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) events = list(repository.issue_events(number=50)) for ev in events: assert isinstan...
'Test that issues will be returned in ascending order.'
def test_issues_sorts_ascendingly(self):
cassette_name = self.cassette_name('issues_ascending') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'betamax') assert (repository is not None) issues = list(repository.issues(direction='asc')) assert (len(issues) > 0) last_issue ...
'Test that the state parameter accets \'all\'.'
def test_issues_accepts_state_all(self):
cassette_name = self.cassette_name('issues_state_all') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'betamax') assert (repository is not None) for issue in repository.issues(state='all'): assert (issue.state in ('open', 'clos...
'Test the retrieval of a single key.'
def test_key(self):
self.basic_login() cassette_name = self.cassette_name('key') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) key = repository.key(8820641) assert isinstance(key, github3.users.Key)
'Test that the user can retrieve all deploy keys.'
def test_keys(self):
self.basic_login() cassette_name = self.cassette_name('keys') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) keys = list(repository.keys()) assert (len(keys) > 0) for key in keys: ...
'Test that a user can retrieve a repository\'s label.'
def test_label(self):
cassette_name = self.cassette_name('label') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') label = repository.label('bug') assert isinstance(label, github3.issues.label.Label)
'Test that a user can retrieve a repository\'s labels.'
def test_labels(self):
cassette_name = self.cassette_name('labels') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) labels = list(repository.labels()) assert (len(labels) > 0) for label in labels: asse...
'Test that a repository\'s languages can be retrieved.'
def test_languages(self):
cassette_name = self.cassette_name('languages') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) for l in repository.languages(): assert ('ETag' not in l) assert ('Last-Mo...
'Test that a repository\'s license can be retrieved.'
def test_license(self):
cassette_name = self.cassette_name('license') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') license = repository.license() assert isinstance(license, github3.licenses.License)
'Test the ability to mark all notifications on a repository as read.'
def test_mark_notifications(self):
self.token_login() cassette_name = self.cassette_name('mark_notifications') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') marked = repository.mark_notifications('2016-01-12T00:00:00Z') assert (marked is True)
'Test the ability to perform a merge on a repository.'
def test_merge(self):
self.token_login() cassette_name = self.cassette_name('merge') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') commit = repository.merge('base_branch', 'head_branch') assert isinstance(commit, github3.repos.commit.RepoCommit...
'Test the ability to retrieve a milestone on a repository.'
def test_milestone(self):
cassette_name = self.cassette_name('milestone') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) milestone = repository.milestone(7) assert isinstance(milestone, github3.issues.milestone.Mile...
'Test the ability to retrieve the milestones in a repository.'
def test_milestones(self):
cassette_name = self.cassette_name('milestones') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) milestones = list(repository.milestones()) assert (len(milestones) > 0) for milestone in ...
'Test that a user can retrieve the events of a repo\'s network.'
def test_network_events(self):
cassette_name = self.cassette_name('network_events') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) events = list(repository.network_events()) assert (len(events) > 0) for event in even...
'Test that a user can retrieve their repo notifications.'
def test_notifications(self):
self.basic_login() cassette_name = self.cassette_name('notifications') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) notifications = list(repository.notifications()) assert (len(notifi...
'Test that a repository\'s license can be retrieved at repository load.'
def test_original_license(self):
cassette_name = self.cassette_name('original_license') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) assert isinstance(repository.original_license, github3.licenses.License)
'Test that a user can retrieve a pull request from a repo.'
def test_pull_request(self):
cassette_name = self.cassette_name('pull_request') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') pull_request = repository.pull_request(546) assert isinstance(pull_request, github3.pulls.PullRequest)
'Test that a user can retrieve the pull requests from a repo.'
def test_pull_requests(self):
cassette_name = self.cassette_name('pull_requests') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) pulls = list(repository.pull_requests()) assert (len(pulls) > 0) for pull in pulls: ...
'Test that pull_requests now takes a sort parameter.'
def test_pull_requests_accepts_sort_and_direction(self):
cassette_name = self.cassette_name('pull_requests_accept_sort') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'betamax') assert (repository is not None) last_pr = None for pr in repository.pull_requests(sort='updated', direction='...
'Test the ability to retrieve the README.'
def test_readme(self):
cassette_name = self.cassette_name('readme') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') readme = repository.readme() assert isinstance(readme, github3.repos.contents.Contents)
'Test the ability to retrieve a ref.'
def test_ref(self):
cassette_name = self.cassette_name('ref') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') ref = repository.ref('tags/0.9.3') assert isinstance(ref, github3.git.Reference)
'Test the ability to retrieve a single release.'
def test_release(self):
cassette_name = self.cassette_name('release') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) release = repository.release(76677) assert isinstance(release, github3.repos.release.Release)
'Test the ability to retrieve the latest release.'
def test_latest_release(self):
cassette_name = self.cassette_name('latest_release') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) release = repository.latest_release() assert isinstance(release, github3.repos.release.Re...
'Test the ability to retrieve a release by tag name.'
def test_release_from_tag(self):
cassette_name = self.cassette_name('release_from_tag') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) release = repository.release_from_tag('v0.7.1') assert isinstance(release, github3.repo...
'Test the ability to iterate over releases on a repository.'
def test_releases(self):
cassette_name = self.cassette_name('releases') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) for release in repository.releases(): assert isinstance(release, github3.repos.release....
'Test the ability to retrieve the references from a repository.'
def test_refs(self):
cassette_name = self.cassette_name('refs') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) references = list(repository.refs()) assert (len(references) > 0) for ref in references: ...
'Verify github3.exceptions.UnprocessableResponseBody is raised.'
def test_refs_raises_unprocessable_exception(self):
cassette_name = self.cassette_name('invalid_refs') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) with pytest.raises(exc.UnprocessableResponseBody): list(repository.refs('heads/deve...
'Test the ability to remove a collaborator on a repository.'
def test_remove_collaborator(self):
self.token_login() cassette_name = self.cassette_name('remove_collaborator') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'test_rename1') removed_collaborator = repository.remove_collaborator('littleboyd') assert (removed_collaborator is Tr...
'Test the ability to retrieve the stargazers on a repository.'
def test_stargazers(self):
cassette_name = self.cassette_name('stargazers') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'betamax') assert (repository is not None) stargazers = list(repository.stargazers()) assert (len(stargazers) > 0) for user in stargaze...
'Test the ability to retrieve a commit\'s statuses.'
def test_statuses(self):
cassette_name = self.cassette_name('statuses') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) statuses = list(repository.statuses('0cea3860f91717272a5edb3961e9723b70769084')) assert (len(st...
'Test the ability to retrieve a repository\'s subscribers.'
def test_subscribers(self):
cassette_name = self.cassette_name('subscribers') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'betamax') assert (repository is not None) subscribers = list(repository.subscribers()) assert (len(subscribers) > 0) for user in subs...
'Test the ability to subscribe to a repository\'s notifications.'
def test_subscribe(self):
self.basic_login() cassette_name = self.cassette_name('subscribe') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('vcr', 'vcr') assert (repository is not None) subscription = repository.subscribe() assert (subscription.subscribed is True)
'Test the ability to retreive a repository\'s subscription.'
def test_subscription(self):
self.token_login() cassette_name = self.cassette_name('subscription') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') subscription = repository.subscription() assert isinstance(subscription, github3.notifications.Subscription)...
'Test the ability to retrieve an annotated tag.'
def test_tag(self):
cassette_name = self.cassette_name('tag') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') tag = repository.tag('bf1eca5702d6408ab8dbf395c49c2c903a116d33') assert isinstance(tag, github3.git.Tag)
'Test the ability to retrieve a repository\'s tags.'
def test_tags(self):
cassette_name = self.cassette_name('tags') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'betamax') assert (repository is not None) tags = list(repository.tags()) assert (len(tags) > 0) for tag in tags: assert isinstance(t...
'Test the ability to retrieve teams assigned to a repo.'
def test_teams(self):
self.basic_login() cassette_name = self.cassette_name('teams') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'github3.py') assert (repository is not None) teams = list(repository.teams()) assert (len(teams) > 0) for team in teams...
'Test the ability to retrieve a tree from a repository.'
def test_tree(self):
cassette_name = self.cassette_name('tree') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') tree = repository.tree('52a3f30e05cf434285e775979f01f1a8355049a7') assert isinstance(tree, github3.git.Tree)
'Test the ability to retrieve the weekly commit count on a repository.'
def test_weekly_commit_count(self):
cassette_name = self.cassette_name('weekly_commit_count') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') weekly_commit_count = repository.weekly_commit_count() assert isinstance(weekly_commit_count, dict) assert (len(weekly_c...
'Test the ability to delete content from a repository.'
def test_delete(self):
self.token_login() cassette_name = self.cassette_name('delete') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'delete_contents') repository.create_file('test.txt', 'Create test.txt', 'testing') content = repository.file_contents('test...
'Test the ability to update a file\'s content from a repository.'
def test_update(self):
self.token_login() cassette_name = self.cassette_name('update') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'delete_contents') repository.create_file('test.txt', 'Create test.txt', 'testing') content = repository.file_contents('test...
'Test the ability to edit a hook on a repository.'
def test_edit(self):
self.token_login() cassette_name = self.cassette_name('edit') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'delete_contents') hook = repository.hook(7112180) data = {'config': {'url': 'https://requestb.in/15u72q01', 'content_type': 'jso...
'Test the ability to ping a hook on a repository.'
def test_ping(self):
self.token_login() cassette_name = self.cassette_name('ping') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'delete_contents') hook = repository.hook(7112180) pinged = hook.ping() assert pinged
'Test the ability to test a hook on a repository.'
def test_test(self):
self.token_login() cassette_name = self.cassette_name('test') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'delete_contents') hook = repository.hook(7112180) tested = hook.test() assert tested
'Test the ability to delete a repository comment.'
def test_delete(self):
self.token_login() cassette_name = self.cassette_name('delete') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') comment = repository.commit_comment(15779192) deleted = comment.delete() assert deleted
'Test the ability to update a repository comment.'
def test_update(self):
self.token_login() cassette_name = self.cassette_name('update') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') comment = repository.commit_comment(15779254) updated = comment.update(body='Updated by integration t...
'Test the ability to retrieve a diff for a commit.'
def test_diff(self):
cassette_name = self.cassette_name('diff') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') commit = repository.commit('51cfbf8cbf98b0ba5006b3490f553bc05d4461e4') diff = commit.diff() assert diff
'Test the ability to retrieve a patch for a commit.'
def test_patch(self):
cassette_name = self.cassette_name('patch') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') commit = repository.commit('51cfbf8cbf98b0ba5006b3490f553bc05d4461e4') patch = commit.patch() assert patch
'Test the ability to retrieve a diff for a comparison.'
def test_diff(self):
cassette_name = self.cassette_name('diff') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') comparison = repository.compare_commits(base='master', head='develop') diff = comparison.diff() assert diff
'Test the ability to retrieve a diff for a comparison.'
def test_patch(self):
cassette_name = self.cassette_name('patch') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') comparison = repository.compare_commits(base='master', head='develop') patch = comparison.patch() assert patch
'Show that a user can create a deployment status.'
def test_create_status(self):
self.basic_login() cassette_name = self.cassette_name('create_status') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) deployment = find((lambda d: (d.id == 801)), repository.deployments()) ...
'Show that a user can retrieve deployment statuses.'
def test_statuses(self):
cassette_name = self.cassette_name('statuses') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') assert (repository is not None) deployment = find((lambda d: (d.id == 801)), repository.deployments()) assert (deployment i...
'Test the ability to download a release archive.'
@pytest.mark.xfail((requests.__build__ >= 135424), reason='Requests 2.11.0 breaks our cassettes') def test_archive(self):
cassette_name = self.cassette_name('archive') with self.recorder.use_cassette(cassette_name, preserve_exact_body_bytes=True): repository = self.gh.repository('sigmavirus24', 'github3.py') release = repository.release(76677) (_, filename) = tempfile.mkstemp() release.archive('tarb...
'Test the ability to retrieve a single asset from a release.'
def test_asset(self):
cassette_name = self.cassette_name('asset') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') release = repository.release(76677) asset = release.asset(37944) assert (asset is not None) assert isinstance(asset, github3.r...
'Test the ability to iterate over the assets of a release.'
def test_assets(self):
cassette_name = self.cassette_name('assets') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') release = repository.release(76677) for asset in release.assets(): assert isinstance(asset, github3.repos.release.Asset) ...
'Test the ability to delete a release.'
def test_delete(self):
self.token_login() cassette_name = self.cassette_name('delete') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'github3.py') release = repository.create_release('0.8.0.pre', 'develop', '0.8.0 fake release', 'To be deleted') as...
'Test the ability to edit a release on a repository.'
def test_edit(self):
self.token_login() cassette_name = self.cassette_name('edit') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'charade') release = repository.release(85783) assert (release.edit(body='Test editing a release') is True) a...
'Test the ability to upload an asset to a release.'
def test_upload_asset(self):
self.token_login() cassette_name = self.cassette_name('create_release_upload_asset') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') release = repository.create_release('0.8.0.pre', 'develop', '0.8.0 fake release with ...
'Test the ability to upload an asset to a release with a label.'
def test_upload_asset_with_a_label(self):
self.token_login() cassette_name = self.cassette_name('create_release') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') release = repository.create_release('0.8.0.pre', 'develop', '0.8.0 fake release with upload', 'T...
'Test the ability to delete an asset.'
def test_delete(self):
self.basic_login() cassette_name = self.cassette_name('delete') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('github3py', 'github3.py') release = repository.release(833407) asset = release.asset(370020) assert (asset.delete() is True)
'Test the ability to download an asset.'
def test_download(self):
cassette_name = self.cassette_name('download') with self.recorder.use_cassette(cassette_name, preserve_exact_body_bytes=True, **self.betamax_simple_body): repository = self.gh.repository('sigmavirus24', 'github3.py') release = repository.release(76677) asset = next(release.assets()) ...
'Test the ability to download an asset when authenticated.'
def test_download_when_authenticated(self):
self.basic_login() cassette_name = self.cassette_name('download_when_authenticated') with self.recorder.use_cassette(cassette_name, preserve_exact_body_bytes=True, **self.betamax_simple_body): repository = self.gh.repository('sigmavirus24', 'github3.py') release = repository.release(76677) ...
'Test the ability to edit an existing asset.'
def test_edit(self):
self.basic_login() cassette_name = self.cassette_name('create_release_edit') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('itsmemattchung', 'github3.py') release = repository.create_release('0.8.0.pre', 'develop', '0.8.0 fake release with upload...
'Show that a user can retrieve notifications for repository'
def test_subscription(self):
self.token_login() cassette_name = self.cassette_name('subscription') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') threads = list(repository.notifications(all=True)) assert (len(threads) > 0) thread = threads[0]...
'Show that user can successful set subscription'
def test_set(self):
self.token_login() cassette_name = self.cassette_name('set') with self.recorder.use_cassette(cassette_name): repository = self.gh.repository('sigmavirus24', 'github3.py') threads = list(repository.notifications(all='true')) assert (len(threads) > 0) subscription = threads[0]....
'Test the ability to add a label to an issue.'
def test_add_labels(self):
self.token_login() cassette_name = self.cassette_name('add_labels') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=497) labels = issue.add_labels('in progress') assert (len(labels) > 0) for label in la...
'Test the ability to assign a user to an issue.'
def test_assign(self):
self.token_login() cassette_name = self.cassette_name('assign') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=497) assigned = issue.assign('itsmemattchung') assert (assigned is True)
'Test the ability to retrieve an issue comment.'
def test_comment(self):
cassette_name = self.cassette_name('comment') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=497) comment = issue.comment('165547512') assert isinstance(comment, github3.issues.issue.IssueComment)
'Test the ability to retrieve comments on an issue.'
def test_comments(self):
cassette_name = self.cassette_name('comments') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue('sigmavirus24', 'github3.py', 187) assert (issue is not None) comments = list(issue.comments()) assert (len(comments) > 0) for comment in comments: assert ...
'Test the ability to close an issue.'
def test_closed(self):
self.token_login() cassette_name = self.cassette_name('closed') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=509) closed = issue.close() assert (closed is True)
'Test the ability to create a comment on an issue.'
def test_create_comment(self):
self.token_login() cassette_name = self.cassette_name('create_comment') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=509) comment = issue.create_comment(body='Comment from integration test') assert...
'Test the ability to edit an issue.'
def test_edit(self):
self.token_login() cassette_name = self.cassette_name('edit') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=509) edited = issue.edit(title='Integration test for editing an issue') assert (edit...
'Test the ability to edit an issue with multiple assignees.'
def test_edit_multiple_assignees(self):
self.token_login() cassette_name = self.cassette_name('edit_multiple_assignees') with self.recorder.use_cassette(cassette_name): issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=637) assignees = ['itsmemattchung', 'sigmavirus24'] edited = issue.edit(titl...