diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 79d02cdf2c..43018a5c60 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -509,6 +509,47 @@ def create_fork(self, repo): self._requester, headers, data, completed=True ) + def create_repo_from_template( + self, + name, + repo, + description=github.GithubObject.NotSet, + private=github.GithubObject.NotSet, + ): + """ + :calls: `POST /repos/{template_owner}/{template_repo}/generate `_ + :param name: string + :param repo :class:`github.Repository.Repository` + :param description: string + :param private: bool + :rtype: :class:`github.Repository.Repository` + """ + assert isinstance(name, str), name + assert isinstance(repo, github.Repository.Repository), repo + assert description is github.GithubObject.NotSet or isinstance( + description, str + ), description + assert private is github.GithubObject.NotSet or isinstance( + private, bool + ), private + post_parameters = { + "name": name, + "owner": self.login, + } + if description is not github.GithubObject.NotSet: + post_parameters["description"] = description + if private is not github.GithubObject.NotSet: + post_parameters["private"] = private + headers, data = self._requester.requestJsonAndCheck( + "POST", + f"/repos/{repo.owner.login}/{repo.name}/generate", + input=post_parameters, + headers={"Accept": "application/vnd.github.v3+json"}, + ) + return github.Repository.Repository( + self._requester, headers, data, completed=True + ) + def create_gist(self, public, files, description=github.GithubObject.NotSet): """ :calls: `POST /gists `_ diff --git a/github/Consts.py b/github/Consts.py index 9f5aaeeb8c..6f2d9bcb99 100644 --- a/github/Consts.py +++ b/github/Consts.py @@ -99,6 +99,9 @@ # https://developer.github.com/changes/2018-05-24-user-migration-api/ mediaTypeMigrationPreview = "application/vnd.github.wyandotte-preview+json" +# https://developer.github.com/changes/2019-07-16-repository-templates-api/ +mediaTypeTemplatesPreview = "application/vnd.github.baptiste-preview+json" + # https://docs.github.com/en/rest/reference/search#highlighting-code-search-results-1 highLightSearchPreview = "application/vnd.github.v3.text-match+json" diff --git a/github/Organization.py b/github/Organization.py index 33d5b7486a..723629d4ce 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -403,6 +403,47 @@ def create_fork(self, repo): self._requester, headers, data, completed=True ) + def create_repo_from_template( + self, + name, + repo, + description=github.GithubObject.NotSet, + private=github.GithubObject.NotSet, + ): + """self.name + :calls: `POST /repos/{template_owner}/{template_repo}/generate `_ + :param name: string + :param repo :class:`github.Repository.Repository` + :param description: string + :param private: bool + :rtype: :class:`github.Repository.Repository` + """ + assert isinstance(name, str), name + assert isinstance(repo, github.Repository.Repository), repo + assert description is github.GithubObject.NotSet or isinstance( + description, str + ), description + assert private is github.GithubObject.NotSet or isinstance( + private, bool + ), private + post_parameters = { + "name": name, + "owner": self.login, + } + if description is not github.GithubObject.NotSet: + post_parameters["description"] = description + if private is not github.GithubObject.NotSet: + post_parameters["private"] = private + headers, data = self._requester.requestJsonAndCheck( + "POST", + f"/repos/{repo.owner.login}/{repo.name}/generate", + input=post_parameters, + headers={"Accept": "application/vnd.github.v3+json"}, + ) + return github.Repository.Repository( + self._requester, headers, data, completed=True + ) + def create_hook( self, name, diff --git a/github/Repository.py b/github/Repository.py index 6b4af5a6e6..aef02f2f1f 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -473,6 +473,14 @@ def id(self): self._completeIfNotSet(self._id) return self._id.value + @property + def is_template(self): + """ + :type: bool + """ + self._completeIfNotSet(self._is_template) + return self._is_template.value + @property def issue_comment_url(self): """ @@ -763,6 +771,14 @@ def teams_url(self): self._completeIfNotSet(self._teams_url) return self._teams_url.value + @property + def topics(self): + """ + :type: list of strings + """ + self._completeIfNotSet(self._topics) + return self._topics.value + @property def trees_url(self): """ @@ -995,7 +1011,6 @@ def create_git_tag_and_release( """ Convenience function that calls :meth:`Repository.create_git_tag` and :meth:`Repository.create_git_release`. - :param tag: string :param tag_message: string :param release_name: string @@ -3729,6 +3744,7 @@ def _initAttributes(self): self._hooks_url = github.GithubObject.NotSet self._html_url = github.GithubObject.NotSet self._id = github.GithubObject.NotSet + self._is_template = github.GithubObject.NotSet self._issue_comment_url = github.GithubObject.NotSet self._issue_events_url = github.GithubObject.NotSet self._issues_url = github.GithubObject.NotSet @@ -3765,6 +3781,7 @@ def _initAttributes(self): self._svn_url = github.GithubObject.NotSet self._tags_url = github.GithubObject.NotSet self._teams_url = github.GithubObject.NotSet + self._topics = github.GithubObject.NotSet self._trees_url = github.GithubObject.NotSet self._updated_at = github.GithubObject.NotSet self._url = github.GithubObject.NotSet @@ -3871,6 +3888,8 @@ def _useAttributes(self, attributes): self._html_url = self._makeStringAttribute(attributes["html_url"]) if "id" in attributes: # pragma no branch self._id = self._makeIntAttribute(attributes["id"]) + if "is_template" in attributes: # pragma no branch + self._is_template = self._makeBoolAttribute(attributes["is_template"]) if "issue_comment_url" in attributes: # pragma no branch self._issue_comment_url = self._makeStringAttribute( attributes["issue_comment_url"] @@ -3971,6 +3990,8 @@ def _useAttributes(self, attributes): self._teams_url = self._makeStringAttribute(attributes["teams_url"]) if "trees_url" in attributes: # pragma no branch self._trees_url = self._makeStringAttribute(attributes["trees_url"]) + if "topics" in attributes: # pragma no branch + self._topics = self._makeListOfStringsAttribute(attributes["topics"]) if "updated_at" in attributes: # pragma no branch self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"]) if "url" in attributes: # pragma no branch diff --git a/tests/AuthenticatedUser.py b/tests/AuthenticatedUser.py index 61edafe77b..ca0b999fdf 100644 --- a/tests/AuthenticatedUser.py +++ b/tests/AuthenticatedUser.py @@ -664,6 +664,32 @@ def testCreateFork(self): repo = self.user.create_fork(self.g.get_user("nvie").get_repo("gitflow")) self.assertEqual(repo.source.full_name, "nvie/gitflow") + def testCreateRepoFromTemplate(self): + template_repo = self.g.get_repo("actions/hello-world-docker-action") + + repo = self.user.create_repo_from_template( + "hello-world-docker-action-new", template_repo + ) + self.assertEqual( + repo.url, + "https://api.github.com/repos/jacquev6/hello-world-docker-action-new", + ) + self.assertFalse(repo.is_template) + + def testCreateRepoFromTemplateWithAllArguments(self): + template_repo = self.g.get_repo("actions/hello-world-docker-action") + + description = "My repo from template" + private = True + repo = self.user.create_repo_from_template( + "hello-world-docker-action-new", + template_repo, + description=description, + private=private, + ) + self.assertEqual(repo.description, description) + self.assertTrue(repo.private) + def testGetNotification(self): notification = self.user.get_notification("8406712") self.assertEqual(notification.id, "8406712") diff --git a/tests/Organization.py b/tests/Organization.py index 3f68a770d8..18b711b166 100644 --- a/tests/Organization.py +++ b/tests/Organization.py @@ -358,6 +358,32 @@ def testCreateFork(self): self.assertFalse(repo.has_wiki) self.assertFalse(repo.has_pages) + def testCreateRepoFromTemplate(self): + template_repo = self.g.get_repo("actions/hello-world-docker-action") + + repo = self.org.create_repo_from_template( + "hello-world-docker-action-new", template_repo + ) + self.assertEqual( + repo.url, + "https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new", + ) + self.assertFalse(repo.is_template) + + def testCreateRepoFromTemplateWithAllArguments(self): + template_repo = self.g.get_repo("actions/hello-world-docker-action") + + description = "My repo from template" + private = True + repo = self.org.create_repo_from_template( + "hello-world-docker-action-new", + template_repo, + description=description, + private=private, + ) + self.assertEqual(repo.description, description) + self.assertTrue(repo.private) + @mock.patch("github.PublicKey.encrypt") def testCreateSecret(self, encrypt): # encrypt returns a non-deterministic value, we need to mock it so the replay data matches diff --git a/tests/ReplayData/AuthenticatedUser.testCreateRepoFromTemplate.txt b/tests/ReplayData/AuthenticatedUser.testCreateRepoFromTemplate.txt new file mode 100644 index 0000000000..17d22aa222 --- /dev/null +++ b/tests/ReplayData/AuthenticatedUser.testCreateRepoFromTemplate.txt @@ -0,0 +1,33 @@ +https +GET +api.github.com +None +/repos/actions/hello-world-docker-action +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Tue, 11 Feb 2020 16:56:45 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4997'), ('X-RateLimit-Reset', '1581443569'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', 'W/"63c75e6c241c8aa34fa31eaac3091d88"'), ('Last-Modified', 'Fri, 07 Feb 2020 09:28:27 GMT'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '5200:6A2A:85CA2:FC534:5E42DCCD')] +{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","private":false,"owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"admin":false,"push":false,"pull":true},"temp_clone_token":"","organization":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"network_count":30,"subscribers_count":1} + +https +GET +api.github.com +None +/user +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"79f748546e5fc4492505a70de6542183"'), ('date', 'Tue, 08 May 2012 09:51:20 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"public_repos":10,"type":"User","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","followers":13,"bio":"","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","disk_usage":16692,"plan":{"private_repos":5,"space":614400,"name":"micro","collaborators":1},"html_url":"https://github.com/jacquev6","blog":"http://vincent-jacques.net","login":"jacquev6","email":"vincent@vincent-jacques.net","created_at":"2010-07-09T06:10:06Z","company":"Criteo","location":"Paris, France","total_private_repos":5,"public_gists":1,"following":24,"name":"Vincent Jacques","id":327146,"owned_private_repos":5,"private_gists":5,"collaborators":0,"hireable":false,"node_id":"MDQ6VXNlcjMyNzE0Ng=="} + +https +POST +api.github.com +None +/repos/actions/hello-world-docker-action/generate +{'Accept': 'application/vnd.github.v3+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"name": "hello-world-docker-action-new", "owner": "jacquev6"} +201 +[('Server', 'GitHub.com'), ('Date', 'Tue, 11 Feb 2020 16:56:49 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '11775'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4995'), ('X-RateLimit-Reset', '1581443568'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', '"eabd6fce61227c57848e030e45c468c3"'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/jacquev6/hello-world-docker-action-new'), ('X-GitHub-Media-Type', 'github.baptiste-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-GitHub-Request-Id', '8C7A:1AEB:84521:F940F:5E42DCCE')] +{"id":239815940,"node_id":"MDEwOlJlcG9zaXRvcnkyMzk4MTU5NDA=","name":"hello-world-docker-action-new","full_name":"jacquev6/hello-world-docker-action-new","owner":{"login":"jacquev6","id":9718970,"node_id":"MDQ6VXNlcjk3MTg5NzA=","avatar_url":"https://avatars2.githubusercontent.com/u/9718970?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquev6/hello-world-docker-action-new","description":null,"fork":false,"url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new","forks_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/forks","keys_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/teams","hooks_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/events","assignees_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/tags","blobs_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/languages","stargazers_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/subscription","commits_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/merges","archive_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/downloads","issues_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/labels{/name}","releases_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/releases{/id}","deployments_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/deployments","created_at":"2020-02-11T16:56:47Z","updated_at":"2020-02-11T16:56:47Z","pushed_at":"2020-02-11T16:56:48Z","git_url":"git://github.com/jacquev6/hello-world-docker-action-new.git","ssh_url":"git@github.com:jacquev6/hello-world-docker-action-new.git","clone_url":"https://github.com/jacquev6/hello-world-docker-action-new.git","svn_url":"https://github.com/jacquev6/hello-world-docker-action-new","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"pull":true,"push":true,"admin":true},"is_template":false,"template_repository":{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"pull":true,"push":false,"admin":false},"is_template":true},"subscribers_count":1,"network_count":1} + diff --git a/tests/ReplayData/AuthenticatedUser.testCreateRepoFromTemplateWithAllArguments.txt b/tests/ReplayData/AuthenticatedUser.testCreateRepoFromTemplateWithAllArguments.txt new file mode 100644 index 0000000000..c150a5773a --- /dev/null +++ b/tests/ReplayData/AuthenticatedUser.testCreateRepoFromTemplateWithAllArguments.txt @@ -0,0 +1,33 @@ +https +GET +api.github.com +None +/repos/actions/hello-world-docker-action +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Tue, 11 Feb 2020 19:18:56 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4996'), ('X-RateLimit-Reset', '1581452316'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', 'W/"63c75e6c241c8aa34fa31eaac3091d88"'), ('Last-Modified', 'Fri, 07 Feb 2020 09:28:27 GMT'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1BD6:14E8:BA6CC:1C4CAD:5E42FE20')] +{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","private":false,"owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"admin":false,"push":false,"pull":true},"temp_clone_token":"","organization":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"network_count":30,"subscribers_count":1} + +https +GET +api.github.com +None +/user +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"79f748546e5fc4492505a70de6542183"'), ('date', 'Tue, 08 May 2012 09:51:20 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"public_repos":10,"type":"User","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","followers":13,"bio":"","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","disk_usage":16692,"plan":{"private_repos":5,"space":614400,"name":"micro","collaborators":1},"html_url":"https://github.com/jacquev6","blog":"http://vincent-jacques.net","login":"jacquev6","email":"vincent@vincent-jacques.net","created_at":"2010-07-09T06:10:06Z","company":"Criteo","location":"Paris, France","total_private_repos":5,"public_gists":1,"following":24,"name":"Vincent Jacques","id":327146,"owned_private_repos":5,"private_gists":5,"collaborators":0,"hireable":false,"node_id":"MDQ6VXNlcjMyNzE0Ng=="} + +https +POST +api.github.com +None +/repos/actions/hello-world-docker-action/generate +{'Accept': 'application/vnd.github.v3+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"name": "hello-world-docker-action-new", "owner": "jacquev6", "description": "My repo from template", "private": true} +201 +[('Server', 'GitHub.com'), ('Date', 'Tue, 11 Feb 2020 19:18:59 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '11794'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4994'), ('X-RateLimit-Reset', '1581452316'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', '"7fe9f51a711de4ffab9b930e33e3d875"'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/jacquev6/hello-world-docker-action-new'), ('X-GitHub-Media-Type', 'github.baptiste-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-GitHub-Request-Id', '3FB4:2492:632B7:FC388:5E42FE21')] +{"id":239844699,"node_id":"MDEwOlJlcG9zaXRvcnkyMzk4NDQ2OTk=","name":"hello-world-docker-action-new","full_name":"jacquev6/hello-world-docker-action-new","owner":{"login":"jacquev6","id":9718970,"node_id":"MDQ6VXNlcjk3MTg5NzA=","avatar_url":"https://avatars2.githubusercontent.com/u/9718970?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"private":true,"html_url":"https://github.com/jacquev6/hello-world-docker-action-new","description":"My repo from template","fork":false,"url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new","forks_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/forks","keys_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/teams","hooks_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/events","assignees_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/tags","blobs_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/languages","stargazers_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/subscription","commits_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/merges","archive_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/downloads","issues_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/labels{/name}","releases_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/releases{/id}","deployments_url":"https://api.github.com/repos/jacquev6/hello-world-docker-action-new/deployments","created_at":"2020-02-11T19:18:57Z","updated_at":"2020-02-11T19:18:57Z","pushed_at":"2020-02-11T19:18:59Z","git_url":"git://github.com/jacquev6/hello-world-docker-action-new.git","ssh_url":"git@github.com:jacquev6/hello-world-docker-action-new.git","clone_url":"https://github.com/jacquev6/hello-world-docker-action-new.git","svn_url":"https://github.com/jacquev6/hello-world-docker-action-new","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"pull":true,"push":true,"admin":true},"is_template":false,"template_repository":{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"pull":true,"push":false,"admin":false},"is_template":true},"subscribers_count":1,"network_count":1} + diff --git a/tests/ReplayData/Organization.testCreateRepoFromTemplate.txt b/tests/ReplayData/Organization.testCreateRepoFromTemplate.txt new file mode 100644 index 0000000000..95846f8a67 --- /dev/null +++ b/tests/ReplayData/Organization.testCreateRepoFromTemplate.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/repos/actions/hello-world-docker-action +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Wed, 12 Feb 2020 13:54:27 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4998'), ('X-RateLimit-Reset', '1581519266'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', 'W/"63c75e6c241c8aa34fa31eaac3091d88"'), ('Last-Modified', 'Fri, 07 Feb 2020 09:28:27 GMT'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '4A6A:20CC:7983B:E89EF:5E440392')] +{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","private":false,"owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"admin":false,"push":false,"pull":true},"temp_clone_token":"","organization":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"network_count":30,"subscribers_count":1} + +https +POST +api.github.com +None +/repos/actions/hello-world-docker-action/generate +{'Accept': 'application/vnd.github.v3+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"name": "hello-world-docker-action-new", "owner": "BeaverSoftware"} +201 +[('Server', 'GitHub.com'), ('Date', 'Wed, 12 Feb 2020 13:54:29 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '12600'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4997'), ('X-RateLimit-Reset', '1581519266'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', '"36abdc4630fb044196d6efbfc0f644e0"'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new'), ('X-GitHub-Media-Type', 'github.baptiste-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-GitHub-Request-Id', '8C3C:2BF7:ACD4:17C45:5E440393')] +{"id":240025159,"node_id":"MDEwOlJlcG9zaXRvcnkyNDAwMjUxNTk=","name":"hello-world-docker-action-new","full_name":"BeaverSoftware/hello-world-docker-action-new","owner":{"login":"BeaverSoftware","id":60894054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwODk0MDU0","avatar_url":"https://avatars2.githubusercontent.com/u/60894054?v=4","gravatar_id":"","url":"https://api.github.com/users/BeaverSoftware","html_url":"https://github.com/BeaverSoftware","followers_url":"https://api.github.com/users/BeaverSoftware/followers","following_url":"https://api.github.com/users/BeaverSoftware/following{/other_user}","gists_url":"https://api.github.com/users/BeaverSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/BeaverSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BeaverSoftware/subscriptions","organizations_url":"https://api.github.com/users/BeaverSoftware/orgs","repos_url":"https://api.github.com/users/BeaverSoftware/repos","events_url":"https://api.github.com/users/BeaverSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/BeaverSoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BeaverSoftware/hello-world-docker-action-new","description":null,"fork":false,"url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new","forks_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/forks","keys_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/teams","hooks_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/hooks","issue_events_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/issues/events{/number}","events_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/events","assignees_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/assignees{/user}","branches_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/branches{/branch}","tags_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/tags","blobs_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/refs{/sha}","trees_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/statuses/{sha}","languages_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/languages","stargazers_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/stargazers","contributors_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/contributors","subscribers_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/subscribers","subscription_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/subscription","commits_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/commits{/sha}","git_commits_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/commits{/sha}","comments_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/comments{/number}","issue_comment_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/issues/comments{/number}","contents_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/contents/{+path}","compare_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/merges","archive_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/downloads","issues_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/issues{/number}","pulls_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/pulls{/number}","milestones_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/milestones{/number}","notifications_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/labels{/name}","releases_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/releases{/id}","deployments_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/deployments","created_at":"2020-02-12T13:54:28Z","updated_at":"2020-02-12T13:54:28Z","pushed_at":"2020-02-12T13:54:29Z","git_url":"git://github.com/BeaverSoftware/hello-world-docker-action-new.git","ssh_url":"git@github.com:BeaverSoftware/hello-world-docker-action-new.git","clone_url":"https://github.com/BeaverSoftware/hello-world-docker-action-new.git","svn_url":"https://github.com/BeaverSoftware/hello-world-docker-action-new","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"pull":true,"push":true,"admin":true},"is_template":false,"template_repository":{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"pull":true,"push":false,"admin":false},"is_template":true},"organization":{"login":"BeaverSoftware","id":60894054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwODk0MDU0","avatar_url":"https://avatars2.githubusercontent.com/u/60894054?v=4","gravatar_id":"","url":"https://api.github.com/users/BeaverSoftware","html_url":"https://github.com/BeaverSoftware","followers_url":"https://api.github.com/users/BeaverSoftware/followers","following_url":"https://api.github.com/users/BeaverSoftware/following{/other_user}","gists_url":"https://api.github.com/users/BeaverSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/BeaverSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BeaverSoftware/subscriptions","organizations_url":"https://api.github.com/users/BeaverSoftware/orgs","repos_url":"https://api.github.com/users/BeaverSoftware/repos","events_url":"https://api.github.com/users/BeaverSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/BeaverSoftware/received_events","type":"Organization","site_admin":false},"subscribers_count":0,"network_count":1} + diff --git a/tests/ReplayData/Organization.testCreateRepoFromTemplateWithAllArguments.txt b/tests/ReplayData/Organization.testCreateRepoFromTemplateWithAllArguments.txt new file mode 100644 index 0000000000..210ab41645 --- /dev/null +++ b/tests/ReplayData/Organization.testCreateRepoFromTemplateWithAllArguments.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/repos/actions/hello-world-docker-action +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Wed, 12 Feb 2020 18:18:10 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4992'), ('X-RateLimit-Reset', '1581534987'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', 'W/"63c75e6c241c8aa34fa31eaac3091d88"'), ('Last-Modified', 'Fri, 07 Feb 2020 09:28:27 GMT'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '41AB:41D3:1FFAAB:3C0DBC:5E444162')] +{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","private":false,"owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"admin":false,"push":false,"pull":true},"temp_clone_token":"","organization":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"network_count":30,"subscribers_count":1} + +https +POST +api.github.com +None +/repos/actions/hello-world-docker-action/generate +{'Accept': 'application/vnd.github.v3+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"name": "hello-world-docker-action-new", "owner": "BeaverSoftware", "description": "My repo from template", "private": true} +201 +[('Server', 'GitHub.com'), ('Date', 'Wed, 12 Feb 2020 18:18:12 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '12619'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4991'), ('X-RateLimit-Reset', '1581534987'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept'), ('ETag', '"7ab10890a25b4661a4310dc8dbf4491f"'), ('X-OAuth-Scopes', 'public_repo, read:org, read:user, user:email'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new'), ('X-GitHub-Media-Type', 'github.baptiste-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-GitHub-Request-Id', 'C35C:1792:11E12C:2D04D2:5E444162')] +{"id":240083127,"node_id":"MDEwOlJlcG9zaXRvcnkyNDAwODMxMjc=","name":"hello-world-docker-action-new","full_name":"BeaverSoftware/hello-world-docker-action-new","owner":{"login":"BeaverSoftware","id":60894054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwODk0MDU0","avatar_url":"https://avatars2.githubusercontent.com/u/60894054?v=4","gravatar_id":"","url":"https://api.github.com/users/BeaverSoftware","html_url":"https://github.com/BeaverSoftware","followers_url":"https://api.github.com/users/BeaverSoftware/followers","following_url":"https://api.github.com/users/BeaverSoftware/following{/other_user}","gists_url":"https://api.github.com/users/BeaverSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/BeaverSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BeaverSoftware/subscriptions","organizations_url":"https://api.github.com/users/BeaverSoftware/orgs","repos_url":"https://api.github.com/users/BeaverSoftware/repos","events_url":"https://api.github.com/users/BeaverSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/BeaverSoftware/received_events","type":"Organization","site_admin":false},"private":true,"html_url":"https://github.com/BeaverSoftware/hello-world-docker-action-new","description":"My repo from template","fork":false,"url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new","forks_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/forks","keys_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/teams","hooks_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/hooks","issue_events_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/issues/events{/number}","events_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/events","assignees_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/assignees{/user}","branches_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/branches{/branch}","tags_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/tags","blobs_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/refs{/sha}","trees_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/statuses/{sha}","languages_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/languages","stargazers_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/stargazers","contributors_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/contributors","subscribers_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/subscribers","subscription_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/subscription","commits_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/commits{/sha}","git_commits_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/git/commits{/sha}","comments_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/comments{/number}","issue_comment_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/issues/comments{/number}","contents_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/contents/{+path}","compare_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/merges","archive_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/downloads","issues_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/issues{/number}","pulls_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/pulls{/number}","milestones_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/milestones{/number}","notifications_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/labels{/name}","releases_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/releases{/id}","deployments_url":"https://api.github.com/repos/BeaverSoftware/hello-world-docker-action-new/deployments","created_at":"2020-02-12T18:18:11Z","updated_at":"2020-02-12T18:18:11Z","pushed_at":"2020-02-12T18:18:12Z","git_url":"git://github.com/BeaverSoftware/hello-world-docker-action-new.git","ssh_url":"git@github.com:BeaverSoftware/hello-world-docker-action-new.git","clone_url":"https://github.com/BeaverSoftware/hello-world-docker-action-new.git","svn_url":"https://github.com/BeaverSoftware/hello-world-docker-action-new","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"pull":true,"push":true,"admin":true},"is_template":false,"template_repository":{"id":200448202,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA0NDgyMDI=","name":"hello-world-docker-action","full_name":"actions/hello-world-docker-action","owner":{"login":"actions","id":44036562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MDM2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/44036562?v=4","gravatar_id":"","url":"https://api.github.com/users/actions","html_url":"https://github.com/actions","followers_url":"https://api.github.com/users/actions/followers","following_url":"https://api.github.com/users/actions/following{/other_user}","gists_url":"https://api.github.com/users/actions/gists{/gist_id}","starred_url":"https://api.github.com/users/actions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actions/subscriptions","organizations_url":"https://api.github.com/users/actions/orgs","repos_url":"https://api.github.com/users/actions/repos","events_url":"https://api.github.com/users/actions/events{/privacy}","received_events_url":"https://api.github.com/users/actions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/actions/hello-world-docker-action","description":"A template to demonstrate how to build a Docker action.","fork":false,"url":"https://api.github.com/repos/actions/hello-world-docker-action","forks_url":"https://api.github.com/repos/actions/hello-world-docker-action/forks","keys_url":"https://api.github.com/repos/actions/hello-world-docker-action/keys{/key_id}","collaborators_url":"https://api.github.com/repos/actions/hello-world-docker-action/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/actions/hello-world-docker-action/teams","hooks_url":"https://api.github.com/repos/actions/hello-world-docker-action/hooks","issue_events_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/events{/number}","events_url":"https://api.github.com/repos/actions/hello-world-docker-action/events","assignees_url":"https://api.github.com/repos/actions/hello-world-docker-action/assignees{/user}","branches_url":"https://api.github.com/repos/actions/hello-world-docker-action/branches{/branch}","tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/tags","blobs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/refs{/sha}","trees_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/trees{/sha}","statuses_url":"https://api.github.com/repos/actions/hello-world-docker-action/statuses/{sha}","languages_url":"https://api.github.com/repos/actions/hello-world-docker-action/languages","stargazers_url":"https://api.github.com/repos/actions/hello-world-docker-action/stargazers","contributors_url":"https://api.github.com/repos/actions/hello-world-docker-action/contributors","subscribers_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscribers","subscription_url":"https://api.github.com/repos/actions/hello-world-docker-action/subscription","commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/commits{/sha}","git_commits_url":"https://api.github.com/repos/actions/hello-world-docker-action/git/commits{/sha}","comments_url":"https://api.github.com/repos/actions/hello-world-docker-action/comments{/number}","issue_comment_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues/comments{/number}","contents_url":"https://api.github.com/repos/actions/hello-world-docker-action/contents/{+path}","compare_url":"https://api.github.com/repos/actions/hello-world-docker-action/compare/{base}...{head}","merges_url":"https://api.github.com/repos/actions/hello-world-docker-action/merges","archive_url":"https://api.github.com/repos/actions/hello-world-docker-action/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/actions/hello-world-docker-action/downloads","issues_url":"https://api.github.com/repos/actions/hello-world-docker-action/issues{/number}","pulls_url":"https://api.github.com/repos/actions/hello-world-docker-action/pulls{/number}","milestones_url":"https://api.github.com/repos/actions/hello-world-docker-action/milestones{/number}","notifications_url":"https://api.github.com/repos/actions/hello-world-docker-action/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/actions/hello-world-docker-action/labels{/name}","releases_url":"https://api.github.com/repos/actions/hello-world-docker-action/releases{/id}","deployments_url":"https://api.github.com/repos/actions/hello-world-docker-action/deployments","created_at":"2019-08-04T04:10:12Z","updated_at":"2020-02-07T09:28:27Z","pushed_at":"2020-01-17T19:48:23Z","git_url":"git://github.com/actions/hello-world-docker-action.git","ssh_url":"git@github.com:actions/hello-world-docker-action.git","clone_url":"https://github.com/actions/hello-world-docker-action.git","svn_url":"https://github.com/actions/hello-world-docker-action","homepage":"https://help.github.com/en/articles/creating-a-docker-container-action","size":11,"stargazers_count":26,"watchers_count":26,"language":"Dockerfile","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":1,"watchers":26,"default_branch":"master","permissions":{"pull":true,"push":false,"admin":false},"is_template":true},"organization":{"login":"BeaverSoftware","id":60894054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwODk0MDU0","avatar_url":"https://avatars2.githubusercontent.com/u/60894054?v=4","gravatar_id":"","url":"https://api.github.com/users/BeaverSoftware","html_url":"https://github.com/BeaverSoftware","followers_url":"https://api.github.com/users/BeaverSoftware/followers","following_url":"https://api.github.com/users/BeaverSoftware/following{/other_user}","gists_url":"https://api.github.com/users/BeaverSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/BeaverSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BeaverSoftware/subscriptions","organizations_url":"https://api.github.com/users/BeaverSoftware/orgs","repos_url":"https://api.github.com/users/BeaverSoftware/repos","events_url":"https://api.github.com/users/BeaverSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/BeaverSoftware/received_events","type":"Organization","site_admin":false},"subscribers_count":0,"network_count":1} + diff --git a/tests/Repository.py b/tests/Repository.py index 6c39b63a8e..74f1b05e38 100644 --- a/tests/Repository.py +++ b/tests/Repository.py @@ -89,6 +89,7 @@ def testAttributes(self): self.assertEqual(self.repo.homepage, "http://vincent-jacques.net/PyGithub") self.assertEqual(self.repo.html_url, "https://github.com/jacquev6/PyGithub") self.assertEqual(self.repo.id, 3544490) + self.assertIs(self.repo.is_template, None) self.assertEqual(self.repo.language, "Python") self.assertEqual(self.repo.master_branch, None) self.assertEqual(self.repo.name, "PyGithub")