mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Merge branch 'develop' into topic/UnauthenticatedRateLimitedRequests
This commit is contained in:
+1
-1
@@ -3,5 +3,5 @@ python:
|
||||
- "2.7"
|
||||
- "2.6"
|
||||
- "2.5"
|
||||
install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi
|
||||
install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi; if [ "$(python --version 2>&1)" == "Python 2.6.8" ]; then pip install -r python26-requirements.txt --use-mirrors; fi
|
||||
script: python ./setup.py test
|
||||
|
||||
@@ -170,7 +170,7 @@ Orgs
|
||||
|
||||
Repos
|
||||
-----
|
||||
* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads] )`: `Repository`
|
||||
* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, auto_init, gitignore_template] )`: `Repository`
|
||||
* `name`: string
|
||||
* `description`: string
|
||||
* `homepage`: string
|
||||
@@ -178,6 +178,8 @@ Repos
|
||||
* `has_issues`: bool
|
||||
* `has_wiki`: bool
|
||||
* `has_downloads`: bool
|
||||
* `auto_init`: bool
|
||||
* `gitignore_template`: string
|
||||
* `get_repo( name )`: `Repository`
|
||||
* `name`: string
|
||||
* `get_repos( [type, sort, direction] )`: `PaginatedList` of `Repository`
|
||||
@@ -965,7 +967,7 @@ Public_members
|
||||
|
||||
Repos
|
||||
-----
|
||||
* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository`
|
||||
* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id, auto_init, gitignore_template] )`: `Repository`
|
||||
* `name`: string
|
||||
* `description`: string
|
||||
* `homepage`: string
|
||||
@@ -974,6 +976,8 @@ Repos
|
||||
* `has_wiki`: bool
|
||||
* `has_downloads`: bool
|
||||
* `team_id`: `Team`
|
||||
* `auto_init`: bool
|
||||
* `gitignore_template`: string
|
||||
* `get_repo( name )`: `Repository`
|
||||
* `name`: string
|
||||
* `get_repos( [type] )`: `PaginatedList` of `Repository`
|
||||
@@ -1014,6 +1018,7 @@ Class `PullRequest`
|
||||
Attributes
|
||||
----------
|
||||
* `additions`: integer
|
||||
* `assignee`: `NamedUser`
|
||||
* `base`: `PullRequestPart`
|
||||
* `body`: string
|
||||
* `changed_files`: integer
|
||||
@@ -1374,7 +1379,7 @@ Milestones
|
||||
|
||||
Modification
|
||||
------------
|
||||
* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads] )`
|
||||
* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads, default_branch] )`
|
||||
* `name`: string
|
||||
* `description`: string
|
||||
* `homepage`: string
|
||||
@@ -1382,6 +1387,7 @@ Modification
|
||||
* `has_issues`: bool
|
||||
* `has_wiki`: bool
|
||||
* `has_downloads`: bool
|
||||
* `default_branch`: string
|
||||
|
||||
Pulls
|
||||
-----
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -260,7 +262,7 @@ class AuthenticatedUser(GithubObject.GithubObject):
|
||||
)
|
||||
return UserKey.UserKey(self._requester, data, completed=True)
|
||||
|
||||
def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet):
|
||||
def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, auto_init=GithubObject.NotSet, gitignore_template=GithubObject.NotSet):
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage
|
||||
@@ -268,6 +270,8 @@ class AuthenticatedUser(GithubObject.GithubObject):
|
||||
assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues
|
||||
assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki
|
||||
assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads
|
||||
assert auto_init is GithubObject.NotSet or isinstance(auto_init, bool), auto_init
|
||||
assert gitignore_template is GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template
|
||||
post_parameters = {
|
||||
"name": name,
|
||||
}
|
||||
@@ -283,6 +287,10 @@ class AuthenticatedUser(GithubObject.GithubObject):
|
||||
post_parameters["has_wiki"] = has_wiki
|
||||
if has_downloads is not GithubObject.NotSet:
|
||||
post_parameters["has_downloads"] = has_downloads
|
||||
if auto_init is not GithubObject.NotSet:
|
||||
post_parameters["auto_init"] = auto_init
|
||||
if gitignore_template is not GithubObject.NotSet:
|
||||
post_parameters["gitignore_template"] = gitignore_template
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"POST",
|
||||
"/user/repos",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
+6
-4
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -33,14 +35,14 @@ class Github(object):
|
||||
def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None):
|
||||
self.__requester = Requester(login_or_token, password, base_url, timeout, client_id, client_secret)
|
||||
|
||||
@property
|
||||
def FIX_REPO_GET_GIT_REF(self):
|
||||
def get_FIX_REPO_GET_GIT_REF(self):
|
||||
return self.__requester.FIX_REPO_GET_GIT_REF
|
||||
|
||||
@FIX_REPO_GET_GIT_REF.setter
|
||||
def FIX_REPO_GET_GIT_REF(self, value):
|
||||
def set_FIX_REPO_GET_GIT_REF(self, value):
|
||||
self.__requester.FIX_REPO_GET_GIT_REF = value
|
||||
|
||||
FIX_REPO_GET_GIT_REF = property(get_FIX_REPO_GET_GIT_REF, set_FIX_REPO_GET_GIT_REF)
|
||||
|
||||
@property
|
||||
def rate_limiting(self):
|
||||
return self.__requester.rate_limiting
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
+30
-28
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -59,17 +61,17 @@ def convertUser(attributes):
|
||||
"login": attributes["login"],
|
||||
"url": "/users/" + attributes["login"],
|
||||
}
|
||||
if "gravatar_id" in attributes:
|
||||
if "gravatar_id" in attributes: # pragma no branch
|
||||
convertedAttributes["gravatar_id"] = attributes["gravatar_id"]
|
||||
if "followers" in attributes:
|
||||
if "followers" in attributes: # pragma no branch
|
||||
convertedAttributes["followers"] = attributes["followers"]
|
||||
if "repos" in attributes:
|
||||
if "repos" in attributes: # pragma no branch
|
||||
convertedAttributes["public_repos"] = attributes["repos"]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes: # pragma no branch
|
||||
convertedAttributes["name"] = attributes["name"]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes: # pragma no branch
|
||||
convertedAttributes["created_at"] = attributes["created_at"]
|
||||
if "location" in attributes:
|
||||
if "location" in attributes: # pragma no branch
|
||||
convertedAttributes["location"] = attributes["location"]
|
||||
return convertedAttributes
|
||||
|
||||
@@ -79,35 +81,35 @@ def convertRepo(attributes):
|
||||
"owner": {"login": attributes["owner"], "url": "/users/" + attributes["owner"]},
|
||||
"url": "/repos/" + attributes["owner"] + "/" + attributes["name"],
|
||||
}
|
||||
if "pushed_at" in attributes:
|
||||
if "pushed_at" in attributes: # pragma no branch
|
||||
convertedAttributes["pushed_at"] = attributes["pushed_at"]
|
||||
if "homepage" in attributes:
|
||||
if "homepage" in attributes: # pragma no branch
|
||||
convertedAttributes["homepage"] = attributes["homepage"]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes: # pragma no branch
|
||||
convertedAttributes["created_at"] = attributes["created_at"]
|
||||
if "watchers" in attributes:
|
||||
if "watchers" in attributes: # pragma no branch
|
||||
convertedAttributes["watchers"] = attributes["watchers"]
|
||||
if "has_downloads" in attributes:
|
||||
if "has_downloads" in attributes: # pragma no branch
|
||||
convertedAttributes["has_downloads"] = attributes["has_downloads"]
|
||||
if "fork" in attributes:
|
||||
if "fork" in attributes: # pragma no branch
|
||||
convertedAttributes["fork"] = attributes["fork"]
|
||||
if "has_issues" in attributes:
|
||||
if "has_issues" in attributes: # pragma no branch
|
||||
convertedAttributes["has_issues"] = attributes["has_issues"]
|
||||
if "has_wiki" in attributes:
|
||||
if "has_wiki" in attributes: # pragma no branch
|
||||
convertedAttributes["has_wiki"] = attributes["has_wiki"]
|
||||
if "forks" in attributes:
|
||||
if "forks" in attributes: # pragma no branch
|
||||
convertedAttributes["forks"] = attributes["forks"]
|
||||
if "size" in attributes:
|
||||
if "size" in attributes: # pragma no branch
|
||||
convertedAttributes["size"] = attributes["size"]
|
||||
if "private" in attributes:
|
||||
if "private" in attributes: # pragma no branch
|
||||
convertedAttributes["private"] = attributes["private"]
|
||||
if "open_issues" in attributes:
|
||||
if "open_issues" in attributes: # pragma no branch
|
||||
convertedAttributes["open_issues"] = attributes["open_issues"]
|
||||
if "description" in attributes:
|
||||
if "description" in attributes: # pragma no branch
|
||||
convertedAttributes["description"] = attributes["description"]
|
||||
if "language" in attributes:
|
||||
if "language" in attributes: # pragma no branch
|
||||
convertedAttributes["language"] = attributes["language"]
|
||||
if "name" in attributes:
|
||||
if "name" in attributes: # pragma no branch
|
||||
convertedAttributes["name"] = attributes["name"]
|
||||
return convertedAttributes
|
||||
|
||||
@@ -118,18 +120,18 @@ def convertIssue(attributes):
|
||||
"url": "/repos" + urlparse.urlparse(attributes["html_url"]).path,
|
||||
"user": {"login": attributes["user"], "url": "/users/" + attributes["user"]},
|
||||
}
|
||||
if "labels" in attributes:
|
||||
if "labels" in attributes: # pragma no branch
|
||||
convertedAttributes["labels"] = [{"name": label} for label in attributes["labels"]]
|
||||
if "title" in attributes:
|
||||
if "title" in attributes: # pragma no branch
|
||||
convertedAttributes["title"] = attributes["title"]
|
||||
if "created_at" in attributes:
|
||||
if "created_at" in attributes: # pragma no branch
|
||||
convertedAttributes["created_at"] = attributes["created_at"]
|
||||
if "comments" in attributes:
|
||||
if "comments" in attributes: # pragma no branch
|
||||
convertedAttributes["comments"] = attributes["comments"]
|
||||
if "body" in attributes:
|
||||
if "body" in attributes: # pragma no branch
|
||||
convertedAttributes["body"] = attributes["body"]
|
||||
if "updated_at" in attributes:
|
||||
if "updated_at" in attributes: # pragma no branch
|
||||
convertedAttributes["updated_at"] = attributes["updated_at"]
|
||||
if "state" in attributes:
|
||||
if "state" in attributes: # pragma no branch
|
||||
convertedAttributes["state"] = attributes["state"]
|
||||
return convertedAttributes
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -164,7 +166,7 @@ class Organization(GithubObject.GithubObject):
|
||||
)
|
||||
return Repository.Repository(self._requester, data, completed=True)
|
||||
|
||||
def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, team_id=GithubObject.NotSet):
|
||||
def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, team_id=GithubObject.NotSet, auto_init=GithubObject.NotSet, gitignore_template=GithubObject.NotSet):
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage
|
||||
@@ -173,6 +175,8 @@ class Organization(GithubObject.GithubObject):
|
||||
assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki
|
||||
assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads
|
||||
assert team_id is GithubObject.NotSet or isinstance(team_id, Team.Team), team_id
|
||||
assert auto_init is GithubObject.NotSet or isinstance(auto_init, bool), auto_init
|
||||
assert gitignore_template is GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template
|
||||
post_parameters = {
|
||||
"name": name,
|
||||
}
|
||||
@@ -190,6 +194,10 @@ class Organization(GithubObject.GithubObject):
|
||||
post_parameters["has_downloads"] = has_downloads
|
||||
if team_id is not GithubObject.NotSet:
|
||||
post_parameters["team_id"] = team_id._identity
|
||||
if auto_init is not GithubObject.NotSet:
|
||||
post_parameters["auto_init"] = auto_init
|
||||
if gitignore_template is not GithubObject.NotSet:
|
||||
post_parameters["gitignore_template"] = gitignore_template
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"POST",
|
||||
self.url + "/repos",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -29,6 +31,11 @@ class PullRequest(GithubObject.GithubObject):
|
||||
self._completeIfNotSet(self._additions)
|
||||
return self._NoneIfNotSet(self._additions)
|
||||
|
||||
@property
|
||||
def assignee(self):
|
||||
self._completeIfNotSet(self._assignee)
|
||||
return self._NoneIfNotSet(self._assignee)
|
||||
|
||||
@property
|
||||
def base(self):
|
||||
self._completeIfNotSet(self._base)
|
||||
@@ -290,6 +297,7 @@ class PullRequest(GithubObject.GithubObject):
|
||||
|
||||
def _initAttributes(self):
|
||||
self._additions = GithubObject.NotSet
|
||||
self._assignee = GithubObject.NotSet
|
||||
self._base = GithubObject.NotSet
|
||||
self._body = GithubObject.NotSet
|
||||
self._changed_files = GithubObject.NotSet
|
||||
@@ -320,6 +328,9 @@ class PullRequest(GithubObject.GithubObject):
|
||||
if "additions" in attributes: # pragma no branch
|
||||
assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"]
|
||||
self._additions = attributes["additions"]
|
||||
if "assignee" in attributes: # pragma no branch
|
||||
assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"]
|
||||
self._assignee = None if attributes["assignee"] is None else NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False)
|
||||
if "base" in attributes: # pragma no branch
|
||||
assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"]
|
||||
self._base = None if attributes["base"] is None else PullRequestPart.PullRequestPart(self._requester, attributes["base"], completed=False)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -465,7 +467,7 @@ class Repository(GithubObject.GithubObject):
|
||||
None
|
||||
)
|
||||
|
||||
def edit(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, public=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet):
|
||||
def edit(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, public=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, default_branch=GithubObject.NotSet):
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage
|
||||
@@ -473,6 +475,7 @@ class Repository(GithubObject.GithubObject):
|
||||
assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues
|
||||
assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki
|
||||
assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads
|
||||
assert default_branch is GithubObject.NotSet or isinstance(default_branch, (str, unicode)), default_branch
|
||||
post_parameters = {
|
||||
"name": name,
|
||||
}
|
||||
@@ -488,6 +491,8 @@ class Repository(GithubObject.GithubObject):
|
||||
post_parameters["has_wiki"] = has_wiki
|
||||
if has_downloads is not GithubObject.NotSet:
|
||||
post_parameters["has_downloads"] = has_downloads
|
||||
if default_branch is not GithubObject.NotSet:
|
||||
post_parameters["default_branch"] = default_branch
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"PATCH",
|
||||
self.url,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -125,7 +127,7 @@ class Requester:
|
||||
requestHeaders["Authorization"] = "Basic (login and password removed)"
|
||||
elif requestHeaders["Authorization"].startswith("token"):
|
||||
requestHeaders["Authorization"] = "token (oauth token removed)"
|
||||
else:
|
||||
else: # pragma no cover
|
||||
requestHeaders["Authorization"] = "Unknown authorization removed"
|
||||
logger.debug("%s %s://%s%s %s %s ==> %i %s %s", str(verb), self.__scheme, self.__hostname, str(url), str(requestHeaders), str(input), status, str(responseHeaders), str(output))
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -20,7 +22,7 @@ from InputGitAuthor import InputGitAuthor
|
||||
from InputGitTreeElement import InputGitTreeElement
|
||||
|
||||
|
||||
def enable_console_debug_logging():
|
||||
def enable_console_debug_logging(): # pragma no cover
|
||||
logger = logging.getLogger("github")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logger.addHandler(logging.StreamHandler())
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -120,6 +122,10 @@ class AuthenticatedUser(Framework.TestCase):
|
||||
repo = self.user.create_repo("TestPyGithub", "Repo created by PyGithub", "http://foobar.com", private=False, has_issues=False, has_wiki=False, has_downloads=False)
|
||||
self.assertEqual(repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub")
|
||||
|
||||
def testCreateRepositoryWithAutoInit(self):
|
||||
repo = self.user.create_repo("TestPyGithub", auto_init=True, gitignore_template="Python")
|
||||
self.assertEqual(repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub")
|
||||
|
||||
def testCreateAuthorizationWithoutArguments(self):
|
||||
authorization = self.user.create_authorization()
|
||||
self.assertEqual(authorization.id, 372259)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -21,10 +23,11 @@ atLeastPython26 = sys.hexversion >= 0x02060000
|
||||
|
||||
class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument
|
||||
def testInvalidInput(self):
|
||||
raised = False
|
||||
try:
|
||||
self.g.get_user().create_key("Bad key", "xxx")
|
||||
self.fail("Should have raised")
|
||||
except github.GithubException, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.status, 422)
|
||||
self.assertEqual(
|
||||
exception.data,
|
||||
@@ -43,40 +46,47 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we
|
||||
if atLeastPython26:
|
||||
self.assertEqual(str(exception), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}")
|
||||
else:
|
||||
self.assertEqual(str(exception), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}")
|
||||
self.assertEqual(str(exception), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}") # pragma no cover
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testUnknownObject(self):
|
||||
raised = False
|
||||
try:
|
||||
self.g.get_user().get_repo("Xxx")
|
||||
self.fail("Should have raised")
|
||||
except github.GithubException, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.status, 404)
|
||||
self.assertEqual(exception.data, {"message": "Not Found"})
|
||||
if atLeastPython26:
|
||||
self.assertEqual(str(exception), "404 {u'message': u'Not Found'}")
|
||||
else:
|
||||
self.assertEqual(str(exception), "404 {'message': 'Not Found'}")
|
||||
self.assertEqual(str(exception), "404 {'message': 'Not Found'}") # pragma no cover
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testUnknownUser(self):
|
||||
raised = False
|
||||
try:
|
||||
self.g.get_user("ThisUserShouldReallyNotExist")
|
||||
self.fail("Should have raised")
|
||||
except github.GithubException, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.status, 404)
|
||||
self.assertEqual(exception.data, {"message": "Not Found"})
|
||||
if atLeastPython26:
|
||||
self.assertEqual(str(exception), "404 {u'message': u'Not Found'}")
|
||||
else:
|
||||
self.assertEqual(str(exception), "404 {'message': 'Not Found'}")
|
||||
self.assertEqual(str(exception), "404 {'message': 'Not Found'}") # pragma no cover
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testBadAuthentication(self):
|
||||
raised = False
|
||||
try:
|
||||
github.Github("BadUser", "BadPassword").get_user().login
|
||||
self.fail("Should have raised")
|
||||
except github.GithubException, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.status, 401)
|
||||
self.assertEqual(exception.data, {"message": "Bad credentials"})
|
||||
if atLeastPython26:
|
||||
self.assertEqual(str(exception), "401 {u'message': u'Bad credentials'}")
|
||||
else:
|
||||
self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}")
|
||||
self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}") # pragma no cover
|
||||
self.assertTrue(raised)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -39,11 +41,11 @@ def fixAuthorizationHeader(headers):
|
||||
headers["Authorization"] = "token private_token_removed"
|
||||
elif headers["Authorization"].startswith("Basic "):
|
||||
headers["Authorization"] = "Basic login_and_password_removed"
|
||||
else:
|
||||
else: # pragma no cover
|
||||
assert False
|
||||
|
||||
|
||||
class RecordingConnection:
|
||||
class RecordingConnection: # pragma no cover
|
||||
def __init__(self, file, protocol, host, port, *args, **kwds):
|
||||
self.__file = file
|
||||
self.__protocol = protocol
|
||||
@@ -76,14 +78,14 @@ class RecordingConnection:
|
||||
return self.__cnx.close()
|
||||
|
||||
|
||||
class RecordingHttpConnection(RecordingConnection):
|
||||
class RecordingHttpConnection(RecordingConnection): # pragma no cover
|
||||
_realConnection = httplib.HTTPConnection
|
||||
|
||||
def __init__(self, file, *args, **kwds):
|
||||
RecordingConnection.__init__(self, file, "http", *args, **kwds)
|
||||
|
||||
|
||||
class RecordingHttpsConnection(RecordingConnection):
|
||||
class RecordingHttpsConnection(RecordingConnection): # pragma no cover
|
||||
_realConnection = httplib.HTTPSConnection
|
||||
|
||||
def __init__(self, file, *args, **kwds):
|
||||
@@ -130,7 +132,7 @@ class BasicTestCase(unittest.TestCase):
|
||||
unittest.TestCase.setUp(self)
|
||||
self.__fileName = ""
|
||||
self.__file = None
|
||||
if self.recordMode:
|
||||
if self.recordMode: # pragma no cover
|
||||
github.Requester.Requester.injectConnectionClasses(
|
||||
lambda ignored, *args, **kwds: RecordingHttpConnection(self.__openFile("wb"), *args, **kwds),
|
||||
lambda ignored, *args, **kwds: RecordingHttpsConnection(self.__openFile("wb"), *args, **kwds)
|
||||
@@ -165,7 +167,7 @@ class BasicTestCase(unittest.TestCase):
|
||||
|
||||
def __closeReplayFileIfNeeded(self):
|
||||
if self.__file is not None:
|
||||
if not self.recordMode:
|
||||
if not self.recordMode: # pragma no branch
|
||||
self.assertEqual(self.__file.readline(), "")
|
||||
self.__file.close()
|
||||
|
||||
@@ -184,5 +186,5 @@ class TestCase(BasicTestCase):
|
||||
self.g = github.Github(self.login, self.password)
|
||||
|
||||
|
||||
def activateRecordMode():
|
||||
def activateRecordMode(): # pragma no cover
|
||||
BasicTestCase.recordMode = True
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#!/bin/env python
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -95,6 +97,6 @@ class Issue(Framework.TestCase):
|
||||
question = self.repo.get_label("Question")
|
||||
self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Project management", "Question"])
|
||||
self.issue.delete_labels()
|
||||
self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, [])
|
||||
self.assertListKeyEqual(self.issue.get_labels(), None, [])
|
||||
self.issue.set_labels(bug, question)
|
||||
self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Question"])
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -111,6 +113,10 @@ class Organization(Framework.TestCase):
|
||||
repo = self.org.create_repo("TestPyGithub2", "Repo created by PyGithub", "http://foobar.com", False, False, False, False, team)
|
||||
self.assertEqual(repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub2")
|
||||
|
||||
def testCreateRepositoryWithAutoInit(self):
|
||||
repo = self.org.create_repo("TestPyGithub", auto_init=True, gitignore_template="Python")
|
||||
self.assertEqual(repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub")
|
||||
|
||||
def testCreateFork(self):
|
||||
pygithub = self.g.get_user("jacquev6").get_repo("PyGithub")
|
||||
repo = self.org.create_fork(pygithub)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -66,7 +68,7 @@ class PaginatedList(Framework.TestCase):
|
||||
def testInterruptedIteration(self):
|
||||
# No asserts, but checks that only three pages are fetched
|
||||
l = 0
|
||||
for element in self.list:
|
||||
for element in self.list: # pragma no branch (exits only by break)
|
||||
l += 1
|
||||
if l == 75:
|
||||
break
|
||||
@@ -74,7 +76,7 @@ class PaginatedList(Framework.TestCase):
|
||||
def testInterruptedIterationInSlice(self):
|
||||
# No asserts, but checks that only three pages are fetched
|
||||
l = 0
|
||||
for element in self.list[:100]:
|
||||
for element in self.list[:100]: # pragma no branch (exits only by break)
|
||||
l += 1
|
||||
if l == 75:
|
||||
break
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
@@ -24,6 +26,7 @@ class PullRequest(Framework.TestCase):
|
||||
|
||||
def testAttributes(self):
|
||||
self.assertEqual(self.pull.additions, 511)
|
||||
self.assertEqual(self.pull.assignee.login, "jacquev6")
|
||||
self.assertEqual(self.pull.base.label, "jacquev6:topic/RewriteWithGeneratedCode")
|
||||
self.assertEqual(self.pull.base.sha, "ed866fc43833802ab553e5ff8581c81bb00dd433")
|
||||
self.assertEqual(self.pull.base.user.login, "jacquev6")
|
||||
@@ -32,7 +35,7 @@ class PullRequest(Framework.TestCase):
|
||||
self.assertEqual(self.pull.body, "Body edited by PyGithub")
|
||||
self.assertEqual(self.pull.changed_files, 45)
|
||||
self.assertEqual(self.pull.closed_at, datetime.datetime(2012, 5, 27, 10, 29, 7))
|
||||
self.assertEqual(self.pull.comments, 0)
|
||||
self.assertEqual(self.pull.comments, 1)
|
||||
self.assertEqual(self.pull.commits, 3)
|
||||
self.assertEqual(self.pull.created_at, datetime.datetime(2012, 5, 27, 9, 25, 36))
|
||||
self.assertEqual(self.pull.deletions, 384)
|
||||
@@ -41,7 +44,7 @@ class PullRequest(Framework.TestCase):
|
||||
self.assertEqual(self.pull.html_url, "https://github.com/jacquev6/PyGithub/pull/31")
|
||||
self.assertEqual(self.pull.id, 1436215)
|
||||
self.assertEqual(self.pull.issue_url, "https://github.com/jacquev6/PyGithub/issues/31")
|
||||
self.assertEqual(self.pull.mergeable, None)
|
||||
self.assertEqual(self.pull.mergeable, False)
|
||||
self.assertEqual(self.pull.merged, True)
|
||||
self.assertEqual(self.pull.merged_at, datetime.datetime(2012, 5, 27, 10, 29, 7))
|
||||
self.assertEqual(self.pull.merged_by.login, "jacquev6")
|
||||
@@ -50,7 +53,7 @@ class PullRequest(Framework.TestCase):
|
||||
self.assertEqual(self.pull.review_comments, 1)
|
||||
self.assertEqual(self.pull.state, "closed")
|
||||
self.assertEqual(self.pull.title, "Title edited by PyGithub")
|
||||
self.assertEqual(self.pull.updated_at, datetime.datetime(2012, 5, 27, 10, 29, 7))
|
||||
self.assertEqual(self.pull.updated_at, datetime.datetime(2012, 11, 3, 8, 19, 40))
|
||||
self.assertEqual(self.pull.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/31")
|
||||
self.assertEqual(self.pull.user.login, "jacquev6")
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2012 Vincent Jacques
|
||||
# vincent@vincent-jacques.net
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user