desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Test the ability to edit an issue with both
assignee and assignees.'
| def test_edit_both_assignee_and_assignees(self):
| self.token_login()
cassette_name = self.cassette_name('edit_both_assignee_and_assignees')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=637)
assignees = ['itsmemattchung', 'sigmavirus24']
with pytest.rai... |
'Test the ability to iterate over issue events.'
| def test_events(self):
| self.token_login()
cassette_name = self.cassette_name('events')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
issue = repository.issue(218)
for event in issue.events():
assert isinstance(event, github3.issues... |
'Test the ability to iterate over issue labels.'
| def test_labels(self):
| cassette_name = self.cassette_name('labels')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue('sigmavirus24', 'github3.py', 187)
assert (issue is not None)
for label in issue.labels():
assert isinstance(label, github3.issues.label.Label)
|
'Test the ability to lock an issue.'
| def test_lock(self):
| self.token_login()
cassette_name = self.cassette_name('lock')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue(username='adrianmoisey', repository='temptest', number=1)
locked = issue.lock()
assert (locked is True)
|
'Test the ability to retrieve the PR associated with an issue.'
| def test_pull_request(self):
| cassette_name = self.cassette_name('pull_request')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue('sigmavirus24', 'github3.py', 301)
assert (issue is not None)
pull_request = issue.pull_request()
assert isinstance(pull_request, github3.pulls.PullRequest)
|
'Test the ability to remove all labels from an issue.'
| def test_remove_all_labels(self):
| self.token_login()
cassette_name = self.cassette_name('remove_all_labels')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=509)
labels = issue.remove_all_labels()
assert (len(labels) == 0)
|
'Test the ability to reopen an issue.'
| def test_reopen(self):
| self.token_login()
cassette_name = self.cassette_name('reopen')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=509)
reopened = issue.reopen()
assert (reopened is True)
|
'Test the ability to remove a label from an issue.'
| def test_remove_label(self):
| self.token_login()
cassette_name = self.cassette_name('remove_label')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=509)
labels = issue.remove_label('in progress')
assert (len(labels) > 0)
for label i... |
'Test the ability to replace labels from an issue.'
| def test_replace_labels(self):
| self.token_login()
cassette_name = self.cassette_name('replace_labels')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue(username='sigmavirus24', repository='github3.py', number=509)
labels = ['in progress', 'easy']
replaced_labels = issue.replace_labels(label... |
'Test the ability to lock an issue.'
| def test_unlock(self):
| self.token_login()
cassette_name = self.cassette_name('unlock')
with self.recorder.use_cassette(cassette_name):
issue = self.gh.issue(username='adrianmoisey', repository='temptest', number=1)
unlocked = issue.unlock()
assert (unlocked is True)
|
'Test the ability to delete a label.'
| def test_delete(self):
| self.token_login()
cassette_name = self.cassette_name('delete')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('itsmemattchung', 'github3.py')
label = repository.label('deleteme')
assert label.delete()
|
'Test the ability to update a label.'
| def test_update(self):
| self.token_login()
cassette_name = self.cassette_name('update')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('itsmemattchung', 'github3.py')
label = repository.label('integration')
assert label.update('integration', '5319e7')
|
'Test the ability to add scopes to an authorization.'
| def test_add_scopes(self):
| self.basic_login()
cassette_name = self.cassette_name('add_scopes')
with self.recorder.use_cassette(cassette_name):
auth = self.gh.authorization(10716101)
assert isinstance(auth, github3.auths.Authorization)
assert (auth.add_scopes(['user']) is True)
|
'Test the ability to delete an authorization.'
| def test_delete(self):
| self.basic_login()
cassette_name = self.cassette_name('delete')
with self.recorder.use_cassette(cassette_name):
auth = self.gh.authorization(10716101)
assert isinstance(auth, github3.auths.Authorization)
assert (auth.delete() is True)
|
'Test the ability to remove scopes from an authorization.'
| def test_remove_scopes(self):
| self.basic_login()
cassette_name = self.cassette_name('remove_scopes')
with self.recorder.use_cassette(cassette_name):
auth = self.gh.authorization(10716101)
assert isinstance(auth, github3.auths.Authorization)
assert (auth.remove_scopes(['user', 'public_repo']) is True)
|
'Test the ability to replace scopes on an authorization.'
| def test_replace_scopes(self):
| self.basic_login()
cassette_name = self.cassette_name('replace_scopes')
with self.recorder.use_cassette(cassette_name):
auth = self.gh.authorization(10716101)
assert isinstance(auth, github3.auths.Authorization)
assert (auth.replace_scopes(['user', 'public_repo']) is True)
|
'Test the ability to delete a key.'
| def test_delete(self):
| self.token_login()
cassette_name = self.cassette_name('delete')
with self.recorder.use_cassette(cassette_name):
key = self.gh.key(14947878)
assert key.delete()
|
'Test the ability to update a key.'
| def test_update(self):
| self.token_login()
cassette_name = self.cassette_name('update')
with self.recorder.use_cassette(cassette_name):
key = self.gh.key(14948033)
key_text = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD5T3fBQaqmCsJgHvDmlxpF89/nmb9V7sx30pTNPR9h1o/WEwJCdKIoqYcBRnoMUGvGRBh/irJF+jOs4iLm5rd3nC44EIFfUyaHI... |
'Show that a user can retrieve a events performed by a user.'
| def test_events(self):
| cassette_name = self.cassette_name('events')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
events = list(user.events(25))
assert (len(events) > 0)
for event in events:
assert isinstance(event, github3.events.Event)
|
'Show that a user can retrieve any user\'s followers.'
| def test_followers(self):
| cassette_name = self.cassette_name('followers')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
followers = list(user.followers(50))
assert (len(followers) > 0)
for follower in followers:
assert isinstance(follower, github3.users.ShortUser)
|
'Show that a user can retrieve users that a user is following.'
| def test_following(self):
| cassette_name = self.cassette_name('following')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
following = list(user.following(50))
assert (len(following) > 0)
for person in following:
assert isinstance(person, github3.users.ShortUser)
|
'Show that a user can retrieve any user\'s public keys.'
| def test_keys(self):
| cassette_name = self.cassette_name('keys')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
keys = list(user.keys())
assert (len(keys) > 0)
for key in keys:
assert isinstance(key, github3.users.Key)
|
'Show that a user can check if a user can be assigned issues.'
| def test_is_assignee_on(self):
| cassette_name = self.cassette_name('is_assignee_on')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('itsmemattchung')
is_assignee_on = user.is_assignee_on('sigmavirus24', 'github3.py')
assert (is_assignee_on is True)
|
'Show that user can check if a user is following another user.'
| def test_is_following(self):
| cassette_name = self.cassette_name('is_following')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('itsmemattchung')
is_following = user.is_following('sigmavirus24')
assert (is_following is True)
|
'Show that a user can retrieve their events on an organization.'
| def test_organization_events(self):
| self.basic_login()
cassette_name = self.cassette_name('organization_events')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
events = list(user.organization_events('pdfkit', 25))
assert (len(events) > 0)
for event in events:
assert isinstan... |
'Show that a user can retrieve any user\'s organizations.'
| def test_organizations(self):
| cassette_name = self.cassette_name('organizations')
with self.recorder.use_cassette(cassette_name):
u = self.gh.user('sigmavirus24')
for o in u.organizations(number=25):
assert isinstance(o, github3.orgs.Organization)
|
'Show that a user can retrieve any user\'s received events.'
| def test_received_events(self):
| cassette_name = self.cassette_name('received_events')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
events = list(user.received_events(number=25))
assert (len(events) > 0)
for event in events:
assert isinstance(event, github3.events.Event)
|
'Show that a user can retrieve the repositories starred by a user.'
| def test_starred_repositories(self):
| cassette_name = self.cassette_name('starred_repositories')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
repos = list(user.starred_repositories(50))
assert (len(repos) > 0)
for starred in repos:
assert isinstance(starred, github3.repos.Starre... |
'Show that a user can retrieve the repos subscribed to by a user.'
| def test_subscriptions(self):
| cassette_name = self.cassette_name('subscriptions')
with self.recorder.use_cassette(cassette_name):
user = self.gh.user('sigmavirus24')
repos = list(user.subscriptions())
assert (len(repos) > 0)
for repository in repos:
assert isinstance(repository, github3.repos.Repository)
|
'Get the pull request we wish to use in this test.'
| def get_pull_request(self, repository='sigmavirus24/github3.py', num=235):
| (owner, repo) = repository.split('/')
p = self.gh.pull_request(owner, repo, num)
assert isinstance(p, github3.pulls.PullRequest)
return p
|
'Show that one can close an open Pull Request.'
| def test_close(self):
| self.basic_login()
cassette_name = self.cassette_name('close')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request(num=241)
assert (p.close() is True)
|
'Show that a user can create a comment on a PR.'
| def test_create_comment(self):
| self.basic_login()
cassette_name = self.cassette_name('create_comment')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request(num=423)
comment = p.create_comment('Testing pull request comment')
assert isinstance(comment, github3.issues.comment.IssueComment)
|
'Show that one can iterate over a PR\'s commits.'
| def test_commits(self):
| cassette_name = self.cassette_name('commits')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
for commit in p.commits():
assert isinstance(commit, github3.repos.commit.RepoCommit)
|
'Show that a user can create an in-line reveiw comment on a PR.'
| def test_create_review_comment(self):
| self.basic_login()
cassette_name = self.cassette_name('create_review_comment')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request(num=286)
comment = p.create_review_comment(body='Testing review comments', commit_id='4437428aefdb50913e2acabd0552bd13021dc38f', path... |
'Show that one can retrieve a bytestring diff of a PR.'
| def test_diff(self):
| cassette_name = self.cassette_name('diff')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
diff = p.diff()
assert isinstance(diff, bytes)
assert (len(diff) > 0)
|
'Show that one can iterate over a PR\'s files.'
| def test_files(self):
| cassette_name = self.cassette_name('files')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
for pr_file in p.files():
assert isinstance(pr_file, github3.pulls.PullFile)
|
'Show that one can check if a PR was merged.'
| def test_is_merged(self):
| cassette_name = self.cassette_name('is_merged')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
assert (p.is_merged() is True)
|
'Show that one can retrieve the associated issue of a PR.'
| def test_issue(self):
| cassette_name = self.cassette_name('issue')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
issue = p.issue()
assert isinstance(issue, github3.issues.Issue)
|
'Show that one can iterate over a PR\'s issue comments.'
| def test_issue_comments(self):
| cassette_name = self.cassette_name('issue_comments')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
for comment in p.issue_comments():
assert isinstance(comment, github3.issues.comment.IssueComment)
|
'Show that a user can get the patch from a PR.'
| def test_patch(self):
| cassette_name = self.cassette_name('patch')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
patch = p.patch()
assert isinstance(patch, bytes)
assert (len(patch) > 0)
|
'Show that one can iterate over a PR\'s reviews.'
| def test_pull_reviews(self):
| cassette_name = self.cassette_name('pull_reviews')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request(num=671)
for pull_review in p.reviews():
assert isinstance(pull_review, github3.pulls.PullReview)
assert isinstance(pull_review.user, github3.users... |
'Show that one can reopen an open Pull Request.'
| def test_reopen(self):
| self.basic_login()
cassette_name = self.cassette_name('reopen')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request(num=241)
assert (p.reopen() is True)
|
'Show that one can iterate over a PR\'s review comments.'
| def test_review_comments(self):
| cassette_name = self.cassette_name('review_comments')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
for comment in p.review_comments():
assert isinstance(comment, github3.pulls.ReviewComment)
|
'Show that one can update an open Pull Request.'
| def test_update(self):
| self.basic_login()
cassette_name = self.cassette_name('update')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request(num=241)
assert (p.update(p.title) is True)
|
'Show that the pull request has the owner repository.'
| def test_repository(self):
| self.basic_login()
cassette_name = self.cassette_name('single')
with self.recorder.use_cassette(cassette_name):
p = self.get_pull_request()
assert (p.repository == ('sigmavirus24', 'github3.py'))
|
'Show that a user can reply to an existing ReviewComment.'
| def test_reply(self):
| self.basic_login()
cassette_name = self.cassette_name('reply')
with self.recorder.use_cassette(cassette_name):
p = self.gh.pull_request('sigmavirus24', 'github3.py', 286)
c = next(p.review_comments())
comment = c.reply('Replying to comments is fun.')
assert isinstance... |
'Show that a user can retrieve the contents of a PR file.'
| def test_contents(self):
| cassette_name = self.cassette_name('contents')
with self.recorder.use_cassette(cassette_name):
pull_file = self.get_pull_request_file(owner='sigmavirus24', repo='github3.py', pull_number=286, filename='github3/pulls.py')
contents = pull_file.contents()
assert isinstance(contents, repos.c... |
'Test that a tree and its recursed tree are not equal.'
| def test_inequality(self):
| cassette_name = self.cassette_name('ne')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
tree = repository.tree('96726db07528a87b7c1f266ed42cd321070470c2')
recursed = tree.recurse()
assert (tree != recursed)
|
'Test recurse on tree'
| def test_recurse(self):
| cassette_name = self.cassette_name('recurse')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
t = repository.tree('75b347329e3fc87ac78895ca1be58daff78872a1').recurse()
assert isinstance(t.tree[0], github3.git.Hash)
ass... |
'Show that user can update a reference.'
| def test_update(self):
| self.token_login()
cassette_name = self.cassette_name('update')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('itsmemattchung', 'github3.py')
reference = repository.ref('heads/migrate-tests/git-integration-test')
assert (reference.update('b8bcee4db99... |
'Test the ability to use the /emojis endpoint'
| def test_emojis(self):
| cassette_name = self.cassette_name('emojis', cls='GitHub')
with self.recorder.use_cassette(cassette_name):
emojis = self.gh.emojis()
assert (emojis['+1'] is not None)
|
'Test the ability to use the code search endpoint'
| def test_search_code(self):
| cassette_name = self.cassette_name('search_code', cls='GitHub')
with self.recorder.use_cassette(cassette_name):
repos = self.gh.search_code('HTTPAdapter in:file language:python repo:kennethreitz/requests')
assert isinstance(next(repos), github3.search.CodeSearchResult)
|
'Test the ability to use the user search endpoint'
| def test_search_users(self):
| cassette_name = self.cassette_name('search_users', cls='GitHub')
with self.recorder.use_cassette(cassette_name):
users = self.gh.search_users('tom followers:>1000')
assert isinstance(next(users), github3.search.UserSearchResult)
|
'Test the ability to use the issues search endpoint'
| def test_search_issues(self):
| cassette_name = self.cassette_name('search_issues', cls='GitHub')
with self.recorder.use_cassette(cassette_name):
issues = self.gh.search_issues('github3 labels:bugs')
assert isinstance(next(issues), github3.search.IssueSearchResult)
|
'Test the ability to use the repository search endpoint'
| def test_search_repositories(self):
| cassette_name = self.cassette_name('search_repositories', cls='GitHub')
with self.recorder.use_cassette(cassette_name):
repos = self.gh.search_repositories('github3 language:python')
assert isinstance(next(repos), github3.search.RepositorySearchResult)
|
'Test the ability to create an authorization.'
| def test_authorize(self):
| from ..conftest import credentials
(username, password) = credentials
cassette_name = self.cassette_name('authorize')
with self.recorder.use_cassette(cassette_name):
auth = self.gh.authorize(username, password, note='Test authorization', note_url='http://example.com')
assert isinstance(au... |
'Add email addresses to the authorized user\'s account.'
| def test_add_email_addresses(self):
| self.basic_login()
cassette_name = self.cassette_name('add_email_addresses')
with self.recorder.use_cassette(cassette_name):
emails = self.gh.add_email_addresses(['example1@example.com', 'example2@example.com'])
for email in emails:
assert isinstance(email, github3.users.Email)
|
'Test the ability of a GitHub instance to create a new gist.'
| def test_create_gist(self):
| self.token_login()
cassette_name = self.cassette_name('create_gist')
with self.recorder.use_cassette(cassette_name):
g = self.gh.create_gist('Gist Title', {'filename.py': {'content': '#content'}})
assert isinstance(g, github3.gists.Gist)
assert (g.public is True)
|
'Test the ability of a GitHub instance to create a new issue.'
| def test_create_issue(self):
| self.token_login()
cassette_name = self.cassette_name('create_issue')
with self.recorder.use_cassette(cassette_name):
i = self.gh.create_issue('github3py', 'fork_this', 'Test issue creation', "Let's see how well this works with Betamax")
assert isinstance(i, github3.is... |
'Test the ability to create a key and delete it.'
| def test_create_key(self):
| self.basic_login()
cassette_name = self.cassette_name('create_delete_key')
with self.recorder.use_cassette(cassette_name):
k = self.gh.create_key('Key name', SSH_KEY)
k.delete()
assert isinstance(k, github3.users.Key)
assert (k.title == 'Key name')
assert (k.key == SSH_KEY)... |
'Show an authenticated user can create a repository.'
| def test_create_repository(self):
| self.basic_login()
cassette_name = self.cassette_name('create_repository')
with self.recorder.use_cassette(cassette_name):
r = self.gh.create_repository('my-new-repo', description='Test repo creation')
assert isinstance(r, github3.repos.Repository)
assert (str(r) == 'sigmavirus24/my-ne... |
'Delete email addresses from authenticated user\'s account.'
| def test_delete_email_addresses(self):
| self.basic_login()
cassette_name = self.cassette_name('delete_email_addresses')
with self.recorder.use_cassette(cassette_name):
assert (self.gh.delete_email_addresses(['graffatcolmingov+example1@gmail.com', 'graffatcolmingov+example2@gmail.com']) is True)
|
'Test the ability to retrieve from /emojis.'
| def test_emojis(self):
| cassette_name = self.cassette_name('emojis')
with self.recorder.use_cassette(cassette_name):
emojis = self.gh.emojis()
assert isinstance(emojis, dict)
assert emojis['+1'].startswith('https://github')
|
'Test the ability to retrieve from /emojis.'
| def test_emojis_etag(self):
| cassette_name = self.cassette_name('emojis')
with self.recorder.use_cassette(cassette_name):
emojis = self.gh.emojis()
assert ('ETag' not in emojis)
assert ('Last-Modified' not in emojis)
|
'Test the ability to retrieve a user\'s timelime URLs.'
| def test_feeds(self):
| self.basic_login()
cassette_name = self.cassette_name('feeds')
with self.recorder.use_cassette(cassette_name):
feeds = self.gh.feeds()
_links = feeds.pop('_links')
for urls in feeds.values():
if (not isinstance(urls, list)):
urls = [urls]
for url in urls:
... |
'Test the ability to retrieve a single gist.'
| def test_gist(self):
| cassette_name = self.cassette_name('gist')
with self.recorder.use_cassette(cassette_name):
g = self.gh.gist(7160899)
assert isinstance(g, github3.gists.Gist)
|
'Test the ability to retrieve a single gitignore template.'
| def test_gitignore_template(self):
| cassette_name = self.cassette_name('gitignore_template')
with self.recorder.use_cassette(cassette_name):
t = self.gh.gitignore_template('Python')
assert (t is not None)
assert (t != '')
|
'Test the ability to retrieve a user\'s key.'
| def test_key(self):
| self.token_login()
cassette_name = self.cassette_name('key')
with self.recorder.use_cassette(cassette_name):
key = self.gh.key(14948033)
assert isinstance(key, github3.users.Key)
|
'Test the ability to retrieve a single license.'
| def test_license(self):
| cassette_name = self.cassette_name('license')
with self.recorder.use_cassette(cassette_name):
license = self.gh.license('mit')
assert isinstance(license, github3.licenses.License)
|
'Test the ability to retrieve open source licenses.'
| def test_licenses(self):
| cassette_name = self.cassette_name('licenses')
with self.recorder.use_cassette(cassette_name):
licenses = list(self.gh.licenses())
assert (len(licenses) > 0)
license = licenses[0]
assert isinstance(license, github3.licenses.License)
|
'Test the ability to render a markdown document.'
| def test_markdown(self):
| cassette_name = self.cassette_name('markdown')
with self.recorder.use_cassette(cassette_name):
text = 'github3.py **is** a python wrapper'
mode = 'markdown'
markdown = self.gh.markdown(text=text, mode=mode)
html = '<p>github3.py <strong>is</strong> a python wr... |
'Test the ability to retrieve a single gitignore template.'
| def test_non_existent_gitignore_template(self):
| cassette_name = self.cassette_name('non_existent_gitignore_template')
with self.recorder.use_cassette(cassette_name):
t = self.gh.gitignore_template('i_donut_exist')
assert (t is not None)
assert (t == '')
|
'Test the ability to retrieve a list of gitignore templates.'
| def test_gitignore_templates(self):
| cassette_name = self.cassette_name('gitignore_templates')
with self.recorder.use_cassette(cassette_name):
l = self.gh.gitignore_templates()
assert (l != [])
assert isinstance(l, list)
|
'Test the ability to check if a user is being followed.'
| def test_is_following(self):
| self.basic_login()
cassette_name = self.cassette_name('is_following')
with self.recorder.use_cassette(cassette_name):
assert (self.gh.is_following('lukasa') is True)
|
'Test the ability to check if a user starred a repository.'
| def test_is_starred(self):
| self.basic_login()
cassette_name = self.cassette_name('is_starred')
with self.recorder.use_cassette(cassette_name):
assert (self.gh.is_starred('lukasa', 'mkcert') is True)
|
'Test the ability to retrieve a single issue.'
| def test_issue(self):
| cassette_name = self.cassette_name('issue')
with self.recorder.use_cassette(cassette_name):
i = self.gh.issue('sigmavirus24', 'github3.py', 1)
assert isinstance(i, github3.issues.Issue)
|
'Test the ability to iterate over all of the organizations.'
| def test_all_organizations(self):
| cassette_name = self.cassette_name('all_organizations')
with self.recorder.use_cassette(cassette_name):
for r in self.gh.all_organizations(number=25):
assert isinstance(r, github3.orgs.Organization)
|
'Test the ability to iterate over all of the repositories.'
| def test_all_repositories(self):
| cassette_name = self.cassette_name('iter_all_repos')
with self.recorder.use_cassette(cassette_name):
for r in self.gh.all_repositories(number=25):
assert isinstance(r, github3.repos.repo.Repository)
|
'Test the ability to iterate over all of the users.'
| def test_all_users(self):
| cassette_name = self.cassette_name('iter_all_users')
with self.recorder.use_cassette(cassette_name):
for u in self.gh.all_users(number=25):
assert isinstance(u, github3.users.ShortUser)
|
'Test the ability to iterate over all public events.'
| def test_all_events(self):
| cassette_name = self.cassette_name('all_events')
with self.recorder.use_cassette(cassette_name):
for e in self.gh.all_events(number=25):
assert isinstance(e, github3.events.Event)
|
'Test the ability to iterate over a user\'s followers.'
| def test_followers_of(self):
| cassette_name = self.cassette_name('followers_of')
with self.recorder.use_cassette(cassette_name):
for u in self.gh.followers_of('sigmavirus24', number=25):
assert isinstance(u, github3.users.ShortUser)
|
'Test the ability to iterate over an authenticated user\'s followers.
Show the difference between GitHub#followers_of and GitHub#followers.'
| def test_followers(self):
| self.basic_login()
cassette_name = self.cassette_name('followers_auth')
with self.recorder.use_cassette(cassette_name):
for u in self.gh.followers():
assert isinstance(u, github3.users.ShortUser)
|
'Test the ability to iterate over a user\'s teams.'
| def test_user_teams(self):
| self.basic_login()
cassette_name = self.cassette_name('iter_user_teams')
with self.recorder.use_cassette(cassette_name):
for t in self.gh.user_teams():
assert isinstance(t, github3.orgs.Team)
|
'Test the ability to retrieve the authenticated user\'s info.'
| def test_me(self):
| self.basic_login()
cassette_name = self.cassette_name('me')
with self.recorder.use_cassette(cassette_name):
me = self.gh.me()
assert isinstance(me, github3.users.User)
|
'Test the ability to get the CIDR formatted addresses.'
| def test_meta(self):
| cassette_name = self.cassette_name('meta')
with self.recorder.use_cassette(cassette_name):
m = self.gh.meta()
assert isinstance(m, dict)
|
'Test the ability to retrieve unread notifications.'
| def test_notifications(self):
| self.basic_login()
cassette_name = self.cassette_name('unread_notifications')
with self.recorder.use_cassette(cassette_name):
for notification in self.gh.notifications():
assert isinstance(notification, github3.notifications.Thread)
assert (notification.unread is True)
|
'Test the ability to retrieve read notifications as well.'
| def test_notifications_all(self):
| self.basic_login()
cassette_name = self.cassette_name('all_notifications')
with self.recorder.use_cassette(cassette_name):
read_notifications = []
unread_notifications = []
for notification in self.gh.notifications(all=True):
assert isinstance(notification, github3.notifi... |
'Test the ability to use the octocat endpoint.'
| def test_octocat(self):
| cassette_name = self.cassette_name('octocat')
say = 'github3.py is awesome'
with self.recorder.use_cassette(cassette_name):
o = self.gh.octocat()
assert (o is not None)
assert (o is not '')
o = self.gh.octocat(say)
assert (say in o)
|
'Test the ability to retrieve an Organization.'
| def test_organization(self):
| cassette_name = self.cassette_name('organization')
with self.recorder.use_cassette(cassette_name):
o = self.gh.organization('github3py')
assert isinstance(o, github3.orgs.Organization)
|
'Test the ability to create a pubsubhubbub hook.'
| def test_pubsubhubbub(self):
| self.token_login()
cassette_name = self.cassette_name('pubsubhubbub')
with self.recorder.use_cassette(cassette_name, **self.betamax_simple_body):
topic = 'https://github.com/itsmemattchung/github3.py/events/push'
status = self.gh.pubsubhubbub(mode='subscribe', topic=topic, callback='http://r... |
'Test the ability to retrieve a Pull Request.'
| def test_pull_request(self):
| cassette_name = self.cassette_name('pull_request')
with self.recorder.use_cassette(cassette_name):
p = self.gh.pull_request('sigmavirus24', 'github3.py', 119)
assert isinstance(p, github3.pulls.PullRequest)
|
'Test the ability to retrieve rate information.'
| def test_rate_limit(self):
| cassette_name = self.cassette_name('rate_limit')
with self.recorder.use_cassette(cassette_name):
r = self.gh.rate_limit()
assert isinstance(r, dict)
assert ('resources' in r)
|
'Test the ability to retrieve a Repository.'
| def test_repository(self):
| cassette_name = self.cassette_name('repository')
with self.recorder.use_cassette(cassette_name):
r = self.gh.repository('sigmavirus24', 'github3.py')
assert isinstance(r, github3.repos.repo.Repository)
|
'Test the ability to retrieve a repository by its id.'
| def test_repository_with_id(self):
| cassette_name = self.cassette_name('repository_with_id')
with self.recorder.use_cassette(cassette_name):
r = self.gh.repository_with_id(11439734)
assert isinstance(r, github3.repos.repo.Repository)
|
'Test the ability to retrieve an authenticated user\'s repos.'
| def test_repositories(self):
| cassette_name = self.cassette_name('repositories')
self.basic_login()
with self.recorder.use_cassette(cassette_name):
for r in self.gh.repositories():
assert isinstance(r, github3.repos.Repository)
|
'Test the ability to retrieve a user\'s repositories.'
| def test_repositories_by(self):
| cassette_name = self.cassette_name('repositories_by')
with self.recorder.use_cassette(cassette_name):
for r in self.gh.repositories_by('dstufft'):
assert isinstance(r, github3.repos.Repository)
|
'Test the ability to use the code search endpoint.'
| def test_search_code(self):
| cassette_name = self.cassette_name('search_code')
with self.recorder.use_cassette(cassette_name):
result_iterator = self.gh.search_code('HTTPAdapter in:file language:python repo:kennethreitz/requests')
code_result = next(result_iterator)
assert isinstance(code_result, github3.search... |
'Test the ability to use the code search endpoint.'
| def test_search_code_with_text_match(self):
| cassette_name = self.cassette_name('search_code_with_text_match')
with self.recorder.use_cassette(cassette_name, match_requests_on=self.match_on):
result_iterator = self.gh.search_code('HTTPAdapter in:file language:python repo:kennethreitz/requests', text_match=True)
code_result = next(... |
'Test the ability to use the user search endpoint.'
| def test_search_users(self):
| cassette_name = self.cassette_name('search_users')
with self.recorder.use_cassette(cassette_name):
users = self.gh.search_users('tom followers:>1000')
assert isinstance(next(users), github3.search.UserSearchResult)
assert isinstance(users, github3.structs.SearchIterator)
|
'Test the ability to use the user search endpoint.'
| def test_search_users_with_text_match(self):
| cassette_name = self.cassette_name('search_users_with_text_match')
with self.recorder.use_cassette(cassette_name, match_requests_on=self.match_on):
users = self.gh.search_users('tom followers:>1000', text_match=True)
user_result = next(users)
assert isinstance(user_result, github3.sea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.