From b4d895eddd935f9bcd946fc7ccd29bd5319f6c8a Mon Sep 17 00:00:00 2001 From: Shubham Singh <41840111+singh811@users.noreply.github.com> Date: Fri, 21 Dec 2018 09:31:01 +0530 Subject: [PATCH] Adding migration api wrapper (#899) Closes #818 --- github/AuthenticatedUser.py | 45 ++++ github/Consts.py | 4 + github/GithubObject.py | 2 +- github/Migration.py | 219 ++++++++++++++++++ github/Organization.py | 44 ++++ github/Requester.py | 4 +- github/tests/AllTests.py | 1 + github/tests/AuthenticatedUser.py | 6 + github/tests/Migration.py | 91 ++++++++ github/tests/Organization.py | 8 + .../AuthenticatedUser.testCreateMigration.txt | 11 + .../AuthenticatedUser.testGetMigrations.txt | 11 + github/tests/ReplayData/Migration.setUp.txt | 11 + .../tests/ReplayData/Migration.testDelete.txt | 11 + ...Migration.testGetArchiveUrlWhenDeleted.txt | 11 + ...igration.testGetArchiveUrlWhenExported.txt | 11 + ...ation.testGetArchiveUrlWhenNotExported.txt | 11 + .../ReplayData/Migration.testGetStatus.txt | 11 + .../ReplayData/Migration.testUnlockRepo.txt | 11 + .../Organization.testCreateMigration.txt | 22 ++ .../Organization.testGetMigrations.txt | 22 ++ 21 files changed, 564 insertions(+), 3 deletions(-) create mode 100644 github/Migration.py create mode 100644 github/tests/Migration.py create mode 100644 github/tests/ReplayData/AuthenticatedUser.testCreateMigration.txt create mode 100644 github/tests/ReplayData/AuthenticatedUser.testGetMigrations.txt create mode 100644 github/tests/ReplayData/Migration.setUp.txt create mode 100644 github/tests/ReplayData/Migration.testDelete.txt create mode 100644 github/tests/ReplayData/Migration.testGetArchiveUrlWhenDeleted.txt create mode 100644 github/tests/ReplayData/Migration.testGetArchiveUrlWhenExported.txt create mode 100644 github/tests/ReplayData/Migration.testGetArchiveUrlWhenNotExported.txt create mode 100644 github/tests/ReplayData/Migration.testGetStatus.txt create mode 100644 github/tests/ReplayData/Migration.testUnlockRepo.txt create mode 100644 github/tests/ReplayData/Organization.testCreateMigration.txt create mode 100644 github/tests/ReplayData/Organization.testGetMigrations.txt diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 604eb0c8..1cc79b68 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -55,6 +55,7 @@ import github.Issue import github.Event import github.Authorization import github.Notification +import github.Migration import Consts @@ -1139,6 +1140,50 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): input={} ) + def create_migration(self, repos, lock_repositories=github.GithubObject.NotSet, exclude_attachments=github.GithubObject.NotSet): + """ + :calls: `POST /user/migrations`_ + :param repos: list or tuple of str + :param lock_repositories: bool + :param exclude_attachments: bool + :rtype: :class:`github.Migration.Migration` + """ + assert isinstance(repos, (list, tuple)), repos + assert all(isinstance(repo, (str, unicode)) for repo in repos), repos + assert lock_repositories is github.GithubObject.NotSet or isinstance(lock_repositories, bool), lock_repositories + assert exclude_attachments is github.GithubObject.NotSet or isinstance(exclude_attachments, bool), exclude_attachments + post_parameters = { + "repositories": repos + } + if lock_repositories is not github.GithubObject.NotSet: + post_parameters["lock_repositories"] = lock_repositories + if exclude_attachments is not github.GithubObject.NotSet: + post_parameters["exclude_attachments"] = exclude_attachments + headers, data = self._requester.requestJsonAndCheck( + "POST", + "/user/migrations", + input=post_parameters, + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + return github.Migration.Migration(self._requester, headers, data, completed=True) + + def get_migrations(self): + """ + :calls: `GET /user/migrations`_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Migration.Migration` + """ + return github.PaginatedList.PaginatedList( + github.Migration.Migration, + self._requester, + "/user/migrations", + None, + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + def _initAttributes(self): self._avatar_url = github.GithubObject.NotSet self._bio = github.GithubObject.NotSet diff --git a/github/Consts.py b/github/Consts.py index c59f4197..93fcd5b5 100644 --- a/github/Consts.py +++ b/github/Consts.py @@ -48,6 +48,7 @@ RES_LAST_MODIFIED = "last-modified" headerRateLimit = "x-ratelimit-limit" headerRateRemaining = "x-ratelimit-remaining" headerRateReset = "x-ratelimit-reset" +headerOAuthScopes = "x-oauth-scopes" headerOTP = "X-GitHub-OTP" defaultMediaType = "application/octet-stream" @@ -90,6 +91,9 @@ mediaTypeOrganizationInvitationPreview = "application/vnd.github.dazzler-preview # https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews/ mediaTypeRequireMultipleApprovingReviews = "application/vnd.github.luke-cage-preview+json" +# https://developer.github.com/changes/2018-05-24-user-migration-api/ +mediaTypeMigrationPreview = "application/vnd.github.wyandotte-preview+json" + # https://developer.github.com/v3/search/#highlighting-code-search-results-1 highLightSearchPreview = "application/vnd.github.v3.text-match+json" diff --git a/github/GithubObject.py b/github/GithubObject.py index f1ffa752..60ed6c65 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -170,7 +170,7 @@ class GithubObject(object): # The Downloads API has been removed. I'm keeping this branch because I have no mean # to check if it's really useless now. return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S.000Z") # pragma no cover (This branch was used only when creating a download) - elif len(s) == 25: + elif len(s) >= 25: return datetime.datetime.strptime(s[:19], "%Y-%m-%dT%H:%M:%S") + (1 if s[19] == '-' else -1) * datetime.timedelta(hours=int(s[20:22]), minutes=int(s[23:25])) else: return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%SZ") diff --git a/github/Migration.py b/github/Migration.py new file mode 100644 index 00000000..3f6a623c --- /dev/null +++ b/github/Migration.py @@ -0,0 +1,219 @@ +# -*- coding: utf-8 -*- + +############################ Copyrights and license ############################ +# # +# Copyright 2012 Vincent Jacques # +# Copyright 2012 Zearin # +# Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # +# Copyright 2013 martinqt # +# Copyright 2014 Andy Casey # +# Copyright 2014 Vincent Jacques # +# Copyright 2016 Jannis Gebauer # +# Copyright 2016 John Eskew # +# Copyright 2016 Peter Buckley # +# Copyright 2018 sfdye # +# # +# This file is part of PyGithub. # +# http://pygithub.readthedocs.io/ # +# # +# PyGithub is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Lesser General Public License as published by the Free # +# Software Foundation, either version 3 of the License, or (at your option) # +# any later version. # +# # +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # +# details. # +# # +# You should have received a copy of the GNU Lesser General Public License # +# along with PyGithub. If not, see . # +# # +################################################################################ + +import github.GithubObject +import github.PaginatedList + +import github.NamedUser + +import Consts + +class Migration(github.GithubObject.CompletableGithubObject): + """ + This class represents Migrations. The reference can be found here http://developer.github.com/v3/migrations/ + """ + + def __repr__(self): + return self.get__repr__({"state": self._state.value, "url": self._url.value}) + + @property + def id(self): + """ + :type: int + """ + return self._id.value + + @property + def owner(self): + """ + :type: :class:`github.NamedUser.NamedUser` + """ + self._completeIfNotSet(self._owner) + return self._owner.value + + @property + def guid(self): + """ + :type: str + """ + self._completeIfNotSet(self._guid) + return self._guid.value + + @property + def state(self): + """ + :type: str + """ + self._completeIfNotSet(self._guid) + return self._state.value + + @property + def lock_repositories(self): + """ + :type: bool + """ + self._completeIfNotSet(self._repositories) + return self._lock_repositories.value + + @property + def exclude_attachments(self): + """ + :type: bool + """ + self._completeIfNotSet(self._exclude_attachments) + return self._exclude_attachments.value + + @property + def repositories(self): + """ + :type: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` + """ + self._completeIfNotSet(self._repositories) + return self._repositories.value + + @property + def url(self): + """ + :type: str + """ + self._completeIfNotSet(self._url) + return self._url.value + + @property + def created_at(self): + """ + :type: datetime.datetime + :rtype: None + """ + self._completeIfNotSet(self._created_at) + return self._created_at.value + + @property + def updated_at(self): + """ + :type: datetime.datetime + :rtype: None + """ + self._completeIfNotSet(self._updated_at) + return self._updated_at.value + + def get_status(self): + """ + :calls: `GET /user/migrations/:migration_id`_ + :rtype: str + """ + headers, data = self._requester.requestJsonAndCheck( + "GET", + self.url, + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + self._useAttributes(data) + return self.state + + def get_archive_url(self): + """ + :calls: `GET /user/migrations/:migration_id/archive`_ + :rtype: str + """ + headers, data = self._requester.requestJsonAndCheck( + "GET", + self.url + "/archive", + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + return data["data"] + + def delete(self): + """ + :calls: `DELETE /user/migrations/:migration_id/archive`_ + """ + headers, data = self._requester.requestJsonAndCheck( + "DELETE", + self.url + "/archive", + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + + def unlock_repo(self, repo_name): + """ + :calls: `DELETE /user/migrations/:migration_id/repos/:repo_name/lock`_ + :param repo_name: str + :rtype: None + """ + assert isinstance(repo_name, (str, unicode)), repo_name + headers, data = self._requester.requestJsonAndCheck( + "DELETE", + self.url + "/repos/" + repo_name + "/lock", + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + + def _initAttributes(self): + self._id = github.GithubObject.NotSet + self._owner = github.GithubObject.NotSet + self._guid = github.GithubObject.NotSet + self._state = github.GithubObject.NotSet + self._lock_repositories = github.GithubObject.NotSet + self._exclude_attachments = github.GithubObject.NotSet + self._repositories = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + + def _useAttributes(self, attributes): + if "id" in attributes: + self._id = self._makeIntAttribute(attributes["id"]) + if "owner" in attributes: + self._owner = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["owner"]) + if "guid" in attributes: + self._guid = self._makeStringAttribute(attributes["guid"]) + if "state" in attributes: + self._state = self._makeStringAttribute(attributes["state"]) + if "lock_repositories" in attributes: + self._lock_repositories = self._makeBoolAttribute(attributes["lock_repositories"]) + if "exclude_attachments" in attributes: + self._exclude_attachments = self._makeBoolAttribute(attributes["exclude_attachments"]) + if "repositories" in attributes: + self._repositories = self._makeListOfClassesAttribute(github.Repository.Repository, attributes["repositories"]) + if "url" in attributes: + self._url = self._makeStringAttribute(attributes["url"]) + if "created_at" in attributes: + self._created_at = self._makeDatetimeAttribute(attributes["created_at"]) + if "updated_at" in attributes: + self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"]) diff --git a/github/Organization.py b/github/Organization.py index b1051495..33a4e7c2 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -896,6 +896,50 @@ class Organization(github.GithubObject.CompletableGithubObject): self.url + "/public_members/" + public_member._identity ) + def create_migration(self, repos, lock_repositories=github.GithubObject.NotSet, exclude_attachments=github.GithubObject.NotSet): + """ + :calls: `POST /orgs/:org/migrations`_ + :param repos: list or tuple of str + :param lock_repositories: bool + :param exclude_attachments: bool + :rtype: :class:`github.Migration.Migration` + """ + assert isinstance(repos, (list, tuple)), repos + assert all(isinstance(repo, (str, unicode)) for repo in repos), repos + assert lock_repositories is github.GithubObject.NotSet or isinstance(lock_repositories, bool), lock_repositories + assert exclude_attachments is github.GithubObject.NotSet or isinstance(exclude_attachments, bool), exclude_attachments + post_parameters = { + "repositories": repos + } + if lock_repositories is not github.GithubObject.NotSet: + post_parameters["lock_repositories"] = lock_repositories + if exclude_attachments is not github.GithubObject.NotSet: + post_parameters["exclude_attachments"] = exclude_attachments + headers, data = self._requester.requestJsonAndCheck( + "POST", + "/orgs/" + self.login + "/migrations", + input=post_parameters, + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + return github.Migration.Migration(self._requester, headers, data, completed=True) + + def get_migrations(self): + """ + :calls: `GET /orgs/:org/migrations`_ + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Migration.Migration` + """ + return github.PaginatedList.PaginatedList( + github.Migration.Migration, + self._requester, + "/orgs/" + self.login + "/migrations", + None, + headers={ + "Accept": Consts.mediaTypeMigrationPreview + } + ) + def _initAttributes(self): self._avatar_url = github.GithubObject.NotSet self._billing_email = github.GithubObject.NotSet diff --git a/github/Requester.py b/github/Requester.py index 85cbe4cf..3ac8a9fa 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -381,8 +381,8 @@ class Requester: if Consts.headerRateReset in responseHeaders: self.rate_limiting_resettime = int(responseHeaders[Consts.headerRateReset]) - if "x-oauth-scopes" in responseHeaders: - self.oauth_scopes = responseHeaders["x-oauth-scopes"].split(", ") + if Consts.headerOAuthScopes in responseHeaders: + self.oauth_scopes = responseHeaders[Consts.headerOAuthScopes].split(", ") self.DEBUG_ON_RESPONSE(status, responseHeaders, output) diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index 4f2001b1..153eea7c 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -91,6 +91,7 @@ from Tag import * from Team import * from Traffic import * from UserKey import * +from Migration import * from PaginatedList import * from Exceptions import * diff --git a/github/tests/AuthenticatedUser.py b/github/tests/AuthenticatedUser.py index 43cbd410..6b4825c9 100644 --- a/github/tests/AuthenticatedUser.py +++ b/github/tests/AuthenticatedUser.py @@ -251,3 +251,9 @@ class AuthenticatedUser(Framework.TestCase): def testAcceptInvitation(self): self.assertEqual(self.user.accept_invitation(4294886), None) + + def testCreateMigration(self): + self.assertTrue(isinstance(self.user.create_migration(["sample-repo"]), github.Migration.Migration)) + + def testGetMigrations(self): + self.assertEqual(self.user.get_migrations().totalCount, 46) diff --git a/github/tests/Migration.py b/github/tests/Migration.py new file mode 100644 index 00000000..9378fe66 --- /dev/null +++ b/github/tests/Migration.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- + +############################ Copyrights and license ############################ +# # +# Copyright 2012 Vincent Jacques # +# Copyright 2012 Zearin # +# Copyright 2013 Vincent Jacques # +# Copyright 2014 Vincent Jacques # +# Copyright 2015 Christopher Wilcox # +# Copyright 2015 Dan Vanderkam # +# Copyright 2015 Enix Yu # +# Copyright 2015 Kyle Hornberg # +# Copyright 2015 Uriel Corfa # +# Copyright 2016 @tmshn # +# Copyright 2016 Enix Yu # +# Copyright 2016 Jannis Gebauer # +# Copyright 2016 Jimmy Zelinskie # +# Copyright 2016 Peter Buckley # +# Copyright 2018 Hayden Fuss # +# Copyright 2018 Iraquitan Cordeiro Filho # +# Copyright 2018 Jacopo Notarstefano # +# Copyright 2018 Maarten Fonville # +# Copyright 2018 Mateusz Loskot # +# Copyright 2018 Raihaan <31362124+res0nance@users.noreply.github.com> # +# Copyright 2018 Shinichi TAMURA # +# Copyright 2018 Steve Kowalik # +# Copyright 2018 Victor Granic # +# Copyright 2018 Wan Liuyang # +# Copyright 2018 Will Yardley # +# Copyright 2018 sfdye # +# # +# This file is part of PyGithub. # +# http://pygithub.readthedocs.io/ # +# # +# PyGithub is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Lesser General Public License as published by the Free # +# Software Foundation, either version 3 of the License, or (at your option) # +# any later version. # +# # +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # +# details. # +# # +# You should have received a copy of the GNU Lesser General Public License # +# along with PyGithub. If not, see . # +# # +################################################################################ + +import Framework + +import github +import datetime + +class Migration(Framework.TestCase): + + def setUp(self): + Framework.TestCase.setUp(self) + self.user = self.g.get_user() + self.migration = self.user.get_migrations()[0] + + def testAttributes(self): + self.assertEqual(self.migration.id, 25320) + self.assertEqual(self.migration.owner.login, "singh811") + self.assertEqual(self.migration.guid, "608bceae-b790-11e8-8b43-4e3cb0dd56cc") + self.assertEqual(self.migration.state, "exported") + self.assertEqual(self.migration.lock_repositories, False) + self.assertEqual(self.migration.exclude_attachments, False) + self.assertEqual(len(self.migration.repositories), 1) + self.assertEqual(self.migration.repositories[0].name, "sample-repo") + self.assertEqual(self.migration.url, "https://api.github.com/user/migrations/25320") + self.assertEqual(self.migration.created_at, datetime.datetime(2018, 9, 14, 1, 35, 35)) + self.assertEqual(self.migration.updated_at, datetime.datetime(2018, 9, 14, 1, 35, 46)) + + def testGetArchiveUrlWhenNotExported(self): + self.assertRaises(github.UnknownObjectException, lambda: self.migration.get_archive_url()) + + def testGetStatus(self): + self.assertEqual(self.migration.get_status(), "exported") + + def testGetArchiveUrlWhenExported(self): + self.assertEqual(self.migration.get_archive_url(), "https://github-cloud.s3.amazonaws.com/migration/25320/24575?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20180913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180913T201100Z&X-Amz-Expires=300&X-Amz-Signature=a0aeb638facd0c78c1ed3ca86022eddbee91e5fe1bb48ee830f54b8b7b305026&X-Amz-SignedHeaders=host&actor_id=41840111&response-content-disposition=filename%3D608bceae-b790-11e8-8b43-4e3cb0dd56cc.tar.gz&response-content-type=application%2Fx-gzip") + + def testDelete(self): + self.assertEqual(self.migration.delete(), None) + + def testGetArchiveUrlWhenDeleted(self): + self.assertRaises(github.UnknownObjectException, lambda: self.migration.get_archive_url()) + + def testUnlockRepo(self): + self.assertEqual(self.migration.unlock_repo("sample-repo"), None) diff --git a/github/tests/Organization.py b/github/tests/Organization.py index baa786c2..35b0cb37 100644 --- a/github/tests/Organization.py +++ b/github/tests/Organization.py @@ -247,3 +247,11 @@ class Organization(Framework.TestCase): u'message': u'You must be an admin to create an invitation to an organization.' } ) + + def testCreateMigration(self): + self.org = self.g.get_organization("sample-test-organisation") + self.assertTrue(isinstance(self.org.create_migration(["sample-repo"]), github.Migration.Migration)) + + def testGetMigrations(self): + self.org = self.g.get_organization("sample-test-organisation") + self.assertEqual(self.org.get_migrations().totalCount, 2) \ No newline at end of file diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateMigration.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateMigration.txt new file mode 100644 index 00000000..f52b31d4 --- /dev/null +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateMigration.txt @@ -0,0 +1,11 @@ +https +POST +api.github.com +None +/user/migrations +{'Content-Type': 'application/json', 'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +{"repositories": ["sample-repo"]} +201 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 14:27:49 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '6113'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4990'), ('X-RateLimit-Reset', '1536851865'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', '"effe78003c129e46e2cc58a5ac1f001d"'), ('Location', 'https://api.github.com/user/migrations/25309'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.105195'), ('X-GitHub-Request-Id', '8B80:1FE2:1A4DEF4:311C09F:5B9A73E4')] +{"id":25309,"node_id":"MDk6TWlncmF0aW9uMjUzMDk=","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"guid":"30dfcaa4-b761-11e8-9fc8-2531d3207eaf","state":"pending","lock_repositories":false,"exclude_attachments":false,"repositories":[{"id":148631065,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg2MzEwNjU=","name":"sample-repo","full_name":"singh811/sample-repo","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/singh811/sample-repo","description":null,"fork":false,"url":"https://api.github.com/repos/singh811/sample-repo","forks_url":"https://api.github.com/repos/singh811/sample-repo/forks","keys_url":"https://api.github.com/repos/singh811/sample-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/singh811/sample-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/singh811/sample-repo/teams","hooks_url":"https://api.github.com/repos/singh811/sample-repo/hooks","issue_events_url":"https://api.github.com/repos/singh811/sample-repo/issues/events{/number}","events_url":"https://api.github.com/repos/singh811/sample-repo/events","assignees_url":"https://api.github.com/repos/singh811/sample-repo/assignees{/user}","branches_url":"https://api.github.com/repos/singh811/sample-repo/branches{/branch}","tags_url":"https://api.github.com/repos/singh811/sample-repo/tags","blobs_url":"https://api.github.com/repos/singh811/sample-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/singh811/sample-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/singh811/sample-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/singh811/sample-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/singh811/sample-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/singh811/sample-repo/languages","stargazers_url":"https://api.github.com/repos/singh811/sample-repo/stargazers","contributors_url":"https://api.github.com/repos/singh811/sample-repo/contributors","subscribers_url":"https://api.github.com/repos/singh811/sample-repo/subscribers","subscription_url":"https://api.github.com/repos/singh811/sample-repo/subscription","commits_url":"https://api.github.com/repos/singh811/sample-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/singh811/sample-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/singh811/sample-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/singh811/sample-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/singh811/sample-repo/contents/{+path}","compare_url":"https://api.github.com/repos/singh811/sample-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/singh811/sample-repo/merges","archive_url":"https://api.github.com/repos/singh811/sample-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/singh811/sample-repo/downloads","issues_url":"https://api.github.com/repos/singh811/sample-repo/issues{/number}","pulls_url":"https://api.github.com/repos/singh811/sample-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/singh811/sample-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/singh811/sample-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/singh811/sample-repo/labels{/name}","releases_url":"https://api.github.com/repos/singh811/sample-repo/releases{/id}","deployments_url":"https://api.github.com/repos/singh811/sample-repo/deployments","created_at":"2018-09-13T11:58:30Z","updated_at":"2018-09-13T14:27:49Z","pushed_at":"2018-09-13T11:58:31Z","git_url":"git://github.com/singh811/sample-repo.git","ssh_url":"git@github.com:singh811/sample-repo.git","clone_url":"https://github.com/singh811/sample-repo.git","svn_url":"https://github.com/singh811/sample-repo","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,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true}}],"url":"https://api.github.com/user/migrations/25309","created_at":"2018-09-13T19:57:49.000+05:30","updated_at":"2018-09-13T19:57:49.000+05:30"} + diff --git a/github/tests/ReplayData/AuthenticatedUser.testGetMigrations.txt b/github/tests/ReplayData/AuthenticatedUser.testGetMigrations.txt new file mode 100644 index 00000000..192c9453 --- /dev/null +++ b/github/tests/ReplayData/AuthenticatedUser.testGetMigrations.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user/migrations?per_page=1 +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 14:26:23 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4991'), ('X-RateLimit-Reset', '1536851865'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', 'W/"13afe069c96184cd23d268d9b9f2f769"'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Link', '; rel="next", ; rel="last"'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.075443'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '7907:1FE0:A9FC22:18E10B7:5B9A738E')] +[{"id":25308,"node_id":"MDk6TWlncmF0aW9uMjUzMDg=","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"guid":"cb974334-b760-11e8-9900-466f9e1633d8","state":"exported","lock_repositories":false,"exclude_attachments":false,"repositories":[{"id":148631065,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg2MzEwNjU=","name":"sample-repo","full_name":"singh811/sample-repo","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/singh811/sample-repo","description":null,"fork":false,"url":"https://api.github.com/repos/singh811/sample-repo","forks_url":"https://api.github.com/repos/singh811/sample-repo/forks","keys_url":"https://api.github.com/repos/singh811/sample-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/singh811/sample-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/singh811/sample-repo/teams","hooks_url":"https://api.github.com/repos/singh811/sample-repo/hooks","issue_events_url":"https://api.github.com/repos/singh811/sample-repo/issues/events{/number}","events_url":"https://api.github.com/repos/singh811/sample-repo/events","assignees_url":"https://api.github.com/repos/singh811/sample-repo/assignees{/user}","branches_url":"https://api.github.com/repos/singh811/sample-repo/branches{/branch}","tags_url":"https://api.github.com/repos/singh811/sample-repo/tags","blobs_url":"https://api.github.com/repos/singh811/sample-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/singh811/sample-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/singh811/sample-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/singh811/sample-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/singh811/sample-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/singh811/sample-repo/languages","stargazers_url":"https://api.github.com/repos/singh811/sample-repo/stargazers","contributors_url":"https://api.github.com/repos/singh811/sample-repo/contributors","subscribers_url":"https://api.github.com/repos/singh811/sample-repo/subscribers","subscription_url":"https://api.github.com/repos/singh811/sample-repo/subscription","commits_url":"https://api.github.com/repos/singh811/sample-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/singh811/sample-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/singh811/sample-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/singh811/sample-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/singh811/sample-repo/contents/{+path}","compare_url":"https://api.github.com/repos/singh811/sample-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/singh811/sample-repo/merges","archive_url":"https://api.github.com/repos/singh811/sample-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/singh811/sample-repo/downloads","issues_url":"https://api.github.com/repos/singh811/sample-repo/issues{/number}","pulls_url":"https://api.github.com/repos/singh811/sample-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/singh811/sample-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/singh811/sample-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/singh811/sample-repo/labels{/name}","releases_url":"https://api.github.com/repos/singh811/sample-repo/releases{/id}","deployments_url":"https://api.github.com/repos/singh811/sample-repo/deployments","created_at":"2018-09-13T11:58:30Z","updated_at":"2018-09-13T14:24:59Z","pushed_at":"2018-09-13T11:58:31Z","git_url":"git://github.com/singh811/sample-repo.git","ssh_url":"git@github.com:singh811/sample-repo.git","clone_url":"https://github.com/singh811/sample-repo.git","svn_url":"https://github.com/singh811/sample-repo","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,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true}}],"url":"https://api.github.com/user/migrations/25308","archive_url":"https://api.github.com/user/migrations/25308/archive","created_at":"2018-09-13T19:54:59.000+05:30","updated_at":"2018-09-13T19:55:10.000+05:30"}] + diff --git a/github/tests/ReplayData/Migration.setUp.txt b/github/tests/ReplayData/Migration.setUp.txt new file mode 100644 index 00000000..2d3ea052 --- /dev/null +++ b/github/tests/ReplayData/Migration.setUp.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user/migrations +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 20:18:23 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4967'), ('X-RateLimit-Reset', '1536871398'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', 'W/"0e6e9ad6d4eb6ea5556826cc673d7145"'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Link', '; rel="next", ; rel="last"'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.256511'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'F2A0:20F9:4E070C:C80BBD:5B9AC60E')] +[{"id":25320,"node_id":"MDk6TWlncmF0aW9uMjUzMjA=","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"guid":"608bceae-b790-11e8-8b43-4e3cb0dd56cc","state":"exported","lock_repositories":false,"exclude_attachments":false,"repositories":[{"id":148631065,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg2MzEwNjU=","name":"sample-repo","full_name":"singh811/sample-repo","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/singh811/sample-repo","description":null,"fork":false,"url":"https://api.github.com/repos/singh811/sample-repo","forks_url":"https://api.github.com/repos/singh811/sample-repo/forks","keys_url":"https://api.github.com/repos/singh811/sample-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/singh811/sample-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/singh811/sample-repo/teams","hooks_url":"https://api.github.com/repos/singh811/sample-repo/hooks","issue_events_url":"https://api.github.com/repos/singh811/sample-repo/issues/events{/number}","events_url":"https://api.github.com/repos/singh811/sample-repo/events","assignees_url":"https://api.github.com/repos/singh811/sample-repo/assignees{/user}","branches_url":"https://api.github.com/repos/singh811/sample-repo/branches{/branch}","tags_url":"https://api.github.com/repos/singh811/sample-repo/tags","blobs_url":"https://api.github.com/repos/singh811/sample-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/singh811/sample-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/singh811/sample-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/singh811/sample-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/singh811/sample-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/singh811/sample-repo/languages","stargazers_url":"https://api.github.com/repos/singh811/sample-repo/stargazers","contributors_url":"https://api.github.com/repos/singh811/sample-repo/contributors","subscribers_url":"https://api.github.com/repos/singh811/sample-repo/subscribers","subscription_url":"https://api.github.com/repos/singh811/sample-repo/subscription","commits_url":"https://api.github.com/repos/singh811/sample-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/singh811/sample-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/singh811/sample-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/singh811/sample-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/singh811/sample-repo/contents/{+path}","compare_url":"https://api.github.com/repos/singh811/sample-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/singh811/sample-repo/merges","archive_url":"https://api.github.com/repos/singh811/sample-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/singh811/sample-repo/downloads","issues_url":"https://api.github.com/repos/singh811/sample-repo/issues{/number}","pulls_url":"https://api.github.com/repos/singh811/sample-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/singh811/sample-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/singh811/sample-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/singh811/sample-repo/labels{/name}","releases_url":"https://api.github.com/repos/singh811/sample-repo/releases{/id}","deployments_url":"https://api.github.com/repos/singh811/sample-repo/deployments","created_at":"2018-09-13T11:58:30Z","updated_at":"2018-09-13T20:05:35Z","pushed_at":"2018-09-13T11:58:31Z","git_url":"git://github.com/singh811/sample-repo.git","ssh_url":"git@github.com:singh811/sample-repo.git","clone_url":"https://github.com/singh811/sample-repo.git","svn_url":"https://github.com/singh811/sample-repo","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,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true}}],"url":"https://api.github.com/user/migrations/25320","created_at":"2018-09-14T01:35:35.000+05:30","updated_at":"2018-09-14T01:35:46.000+05:30"}] + diff --git a/github/tests/ReplayData/Migration.testDelete.txt b/github/tests/ReplayData/Migration.testDelete.txt new file mode 100644 index 00000000..8abe665e --- /dev/null +++ b/github/tests/ReplayData/Migration.testDelete.txt @@ -0,0 +1,11 @@ +https +DELETE +api.github.com +None +/user/migrations/25320/archive +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 20:14:05 GMT'), ('Content-Type', 'application/octet-stream'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4971'), ('X-RateLimit-Reset', '1536871398'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.083770'), ('X-GitHub-Request-Id', 'F9FA:20FB:A7EA64:165BB04:5B9AC50C')] + + diff --git a/github/tests/ReplayData/Migration.testGetArchiveUrlWhenDeleted.txt b/github/tests/ReplayData/Migration.testGetArchiveUrlWhenDeleted.txt new file mode 100644 index 00000000..d2dbe07c --- /dev/null +++ b/github/tests/ReplayData/Migration.testGetArchiveUrlWhenDeleted.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user/migrations/25320/archive +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +404 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 20:17:43 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '404 Not Found'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4969'), ('X-RateLimit-Reset', '1536871398'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.048286'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'D06B:20FA:80A9D5:128E928:5B9AC5E6')] +{"message":"Not Found","documentation_url":"https://developer.github.com/v3/migrations/users/#download-a-user-migration-archive"} + diff --git a/github/tests/ReplayData/Migration.testGetArchiveUrlWhenExported.txt b/github/tests/ReplayData/Migration.testGetArchiveUrlWhenExported.txt new file mode 100644 index 00000000..b2e0c578 --- /dev/null +++ b/github/tests/ReplayData/Migration.testGetArchiveUrlWhenExported.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user/migrations/25320/archive +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +302 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 20:11:00 GMT'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', '470'), ('Status', '302 Found'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4976'), ('X-RateLimit-Reset', '1536871398'), ('location', 'https://github-cloud.s3.amazonaws.com/migration/25320/24575?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20180913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180913T201100Z&X-Amz-Expires=300&X-Amz-Signature=a0aeb638facd0c78c1ed3ca86022eddbee91e5fe1bb48ee830f54b8b7b305026&X-Amz-SignedHeaders=host&actor_id=41840111&response-content-disposition=filename%3D608bceae-b790-11e8-8b43-4e3cb0dd56cc.tar.gz&response-content-type=application%2Fx-gzip'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.066845'), ('X-GitHub-Request-Id', '72DA:20F9:4DC6B3:C7706A:5B9AC453')] +https://github-cloud.s3.amazonaws.com/migration/25320/24575?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20180913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180913T201100Z&X-Amz-Expires=300&X-Amz-Signature=a0aeb638facd0c78c1ed3ca86022eddbee91e5fe1bb48ee830f54b8b7b305026&X-Amz-SignedHeaders=host&actor_id=41840111&response-content-disposition=filename%3D608bceae-b790-11e8-8b43-4e3cb0dd56cc.tar.gz&response-content-type=application%2Fx-gzip + diff --git a/github/tests/ReplayData/Migration.testGetArchiveUrlWhenNotExported.txt b/github/tests/ReplayData/Migration.testGetArchiveUrlWhenNotExported.txt new file mode 100644 index 00000000..eb775150 --- /dev/null +++ b/github/tests/ReplayData/Migration.testGetArchiveUrlWhenNotExported.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user/migrations/25320/archive +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +404 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 20:05:39 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '404 Not Found'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4978'), ('X-RateLimit-Reset', '1536871398'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.047402'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '87CF:20FB:A75E84:1648F66:5B9AC312')] +{"message":"Not Found","documentation_url":"https://developer.github.com/v3/migrations/users/#download-a-user-migration-archive"} + diff --git a/github/tests/ReplayData/Migration.testGetStatus.txt b/github/tests/ReplayData/Migration.testGetStatus.txt new file mode 100644 index 00000000..3340b2de --- /dev/null +++ b/github/tests/ReplayData/Migration.testGetStatus.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user/migrations/25320 +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 20:12:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4974'), ('X-RateLimit-Reset', '1536871398'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', 'W/"1b6bd1349731bdaaccb858dcffbbaba5"'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.111059'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '2C86:20F9:4DD21A:C78CC4:5B9AC4A2')] +{"id":25320,"node_id":"MDk6TWlncmF0aW9uMjUzMjA=","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"guid":"608bceae-b790-11e8-8b43-4e3cb0dd56cc","state":"exported","lock_repositories":false,"exclude_attachments":false,"repositories":[{"id":148631065,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg2MzEwNjU=","name":"sample-repo","full_name":"singh811/sample-repo","owner":{"login":"singh811","id":41840111,"node_id":"MDQ6VXNlcjQxODQwMTEx","avatar_url":"https://avatars2.githubusercontent.com/u/41840111?v=4","gravatar_id":"","url":"https://api.github.com/users/singh811","html_url":"https://github.com/singh811","followers_url":"https://api.github.com/users/singh811/followers","following_url":"https://api.github.com/users/singh811/following{/other_user}","gists_url":"https://api.github.com/users/singh811/gists{/gist_id}","starred_url":"https://api.github.com/users/singh811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singh811/subscriptions","organizations_url":"https://api.github.com/users/singh811/orgs","repos_url":"https://api.github.com/users/singh811/repos","events_url":"https://api.github.com/users/singh811/events{/privacy}","received_events_url":"https://api.github.com/users/singh811/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/singh811/sample-repo","description":null,"fork":false,"url":"https://api.github.com/repos/singh811/sample-repo","forks_url":"https://api.github.com/repos/singh811/sample-repo/forks","keys_url":"https://api.github.com/repos/singh811/sample-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/singh811/sample-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/singh811/sample-repo/teams","hooks_url":"https://api.github.com/repos/singh811/sample-repo/hooks","issue_events_url":"https://api.github.com/repos/singh811/sample-repo/issues/events{/number}","events_url":"https://api.github.com/repos/singh811/sample-repo/events","assignees_url":"https://api.github.com/repos/singh811/sample-repo/assignees{/user}","branches_url":"https://api.github.com/repos/singh811/sample-repo/branches{/branch}","tags_url":"https://api.github.com/repos/singh811/sample-repo/tags","blobs_url":"https://api.github.com/repos/singh811/sample-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/singh811/sample-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/singh811/sample-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/singh811/sample-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/singh811/sample-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/singh811/sample-repo/languages","stargazers_url":"https://api.github.com/repos/singh811/sample-repo/stargazers","contributors_url":"https://api.github.com/repos/singh811/sample-repo/contributors","subscribers_url":"https://api.github.com/repos/singh811/sample-repo/subscribers","subscription_url":"https://api.github.com/repos/singh811/sample-repo/subscription","commits_url":"https://api.github.com/repos/singh811/sample-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/singh811/sample-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/singh811/sample-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/singh811/sample-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/singh811/sample-repo/contents/{+path}","compare_url":"https://api.github.com/repos/singh811/sample-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/singh811/sample-repo/merges","archive_url":"https://api.github.com/repos/singh811/sample-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/singh811/sample-repo/downloads","issues_url":"https://api.github.com/repos/singh811/sample-repo/issues{/number}","pulls_url":"https://api.github.com/repos/singh811/sample-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/singh811/sample-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/singh811/sample-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/singh811/sample-repo/labels{/name}","releases_url":"https://api.github.com/repos/singh811/sample-repo/releases{/id}","deployments_url":"https://api.github.com/repos/singh811/sample-repo/deployments","created_at":"2018-09-13T11:58:30Z","updated_at":"2018-09-13T20:05:35Z","pushed_at":"2018-09-13T11:58:31Z","git_url":"git://github.com/singh811/sample-repo.git","ssh_url":"git@github.com:singh811/sample-repo.git","clone_url":"https://github.com/singh811/sample-repo.git","svn_url":"https://github.com/singh811/sample-repo","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,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true}}],"url":"https://api.github.com/user/migrations/25320","archive_url":"https://api.github.com/user/migrations/25320/archive","created_at":"2018-09-14T01:35:35.000+05:30","updated_at":"2018-09-14T01:35:46.000+05:30"} + diff --git a/github/tests/ReplayData/Migration.testUnlockRepo.txt b/github/tests/ReplayData/Migration.testUnlockRepo.txt new file mode 100644 index 00000000..487a0b2e --- /dev/null +++ b/github/tests/ReplayData/Migration.testUnlockRepo.txt @@ -0,0 +1,11 @@ +https +DELETE +api.github.com +None +/user/migrations/25320/repos/sample-repo/lock +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 20:18:24 GMT'), ('Content-Type', 'application/octet-stream'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4966'), ('X-RateLimit-Reset', '1536871398'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.123605'), ('X-GitHub-Request-Id', '1EA2:20FA:80B1CA:128FAE1:5B9AC610')] + + diff --git a/github/tests/ReplayData/Organization.testCreateMigration.txt b/github/tests/ReplayData/Organization.testCreateMigration.txt new file mode 100644 index 00000000..e95fd2ea --- /dev/null +++ b/github/tests/ReplayData/Organization.testCreateMigration.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/orgs/sample-test-organisation +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 15:19:47 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', '1536855475'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', 'W/"1b018825113df112cbfdf5096ac86cfd"'), ('Last-Modified', 'Thu, 13 Sep 2018 09:21:05 GMT'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.063567'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1CD7:1FE1:13159D3:27509C2:5B9A8012')] +{"login":"sample-test-organisation","id":43235726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjM1NzI2","url":"https://api.github.com/orgs/sample-test-organisation","repos_url":"https://api.github.com/orgs/sample-test-organisation/repos","events_url":"https://api.github.com/orgs/sample-test-organisation/events","hooks_url":"https://api.github.com/orgs/sample-test-organisation/hooks","issues_url":"https://api.github.com/orgs/sample-test-organisation/issues","members_url":"https://api.github.com/orgs/sample-test-organisation/members{/member}","public_members_url":"https://api.github.com/orgs/sample-test-organisation/public_members{/member}","avatar_url":"https://avatars3.githubusercontent.com/u/43235726?v=4","description":null,"is_verified":false,"has_organization_projects":true,"has_repository_projects":true,"public_repos":1,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/sample-test-organisation","created_at":"2018-09-13T09:21:05Z","updated_at":"2018-09-13T09:21:05Z","type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":0,"collaborators":0,"billing_email":"tfv60722@nbzmr.com","plan":{"name":"free","space":976562499,"private_repos":0,"filled_seats":1,"seats":0},"default_repository_permission":"read","members_can_create_repositories":true,"two_factor_requirement_enabled":false} + +https +POST +api.github.com +None +/orgs/sample-test-organisation/migrations +{'Content-Type': 'application/json', 'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +{"repositories": ["sample-repo"]} +201 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 15:19:49 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '7250'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4996'), ('X-RateLimit-Reset', '1536855475'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', '"81072c1f2dc51776a047a3b1816a467d"'), ('Location', 'https://api.github.com/orgs/sample-test-organisation/migrations/25312'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.174479'), ('X-GitHub-Request-Id', 'BF95:1FE1:1315A51:2750AC3:5B9A8014')] +{"id":25312,"node_id":"MDk6TWlncmF0aW9uMjUzMTI=","owner":{"login":"sample-test-organisation","id":43235726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjM1NzI2","avatar_url":"https://avatars3.githubusercontent.com/u/43235726?v=4","gravatar_id":"","url":"https://api.github.com/users/sample-test-organisation","html_url":"https://github.com/sample-test-organisation","followers_url":"https://api.github.com/users/sample-test-organisation/followers","following_url":"https://api.github.com/users/sample-test-organisation/following{/other_user}","gists_url":"https://api.github.com/users/sample-test-organisation/gists{/gist_id}","starred_url":"https://api.github.com/users/sample-test-organisation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sample-test-organisation/subscriptions","organizations_url":"https://api.github.com/users/sample-test-organisation/orgs","repos_url":"https://api.github.com/users/sample-test-organisation/repos","events_url":"https://api.github.com/users/sample-test-organisation/events{/privacy}","received_events_url":"https://api.github.com/users/sample-test-organisation/received_events","type":"Organization","site_admin":false},"guid":"74ac62cc-b768-11e8-8695-688280338423","state":"pending","lock_repositories":false,"exclude_attachments":false,"repositories":[{"id":148654765,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg2NTQ3NjU=","name":"sample-repo","full_name":"sample-test-organisation/sample-repo","owner":{"login":"sample-test-organisation","id":43235726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjM1NzI2","avatar_url":"https://avatars3.githubusercontent.com/u/43235726?v=4","gravatar_id":"","url":"https://api.github.com/users/sample-test-organisation","html_url":"https://github.com/sample-test-organisation","followers_url":"https://api.github.com/users/sample-test-organisation/followers","following_url":"https://api.github.com/users/sample-test-organisation/following{/other_user}","gists_url":"https://api.github.com/users/sample-test-organisation/gists{/gist_id}","starred_url":"https://api.github.com/users/sample-test-organisation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sample-test-organisation/subscriptions","organizations_url":"https://api.github.com/users/sample-test-organisation/orgs","repos_url":"https://api.github.com/users/sample-test-organisation/repos","events_url":"https://api.github.com/users/sample-test-organisation/events{/privacy}","received_events_url":"https://api.github.com/users/sample-test-organisation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sample-test-organisation/sample-repo","description":null,"fork":false,"url":"https://api.github.com/repos/sample-test-organisation/sample-repo","forks_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/forks","keys_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/teams","hooks_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/hooks","issue_events_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/issues/events{/number}","events_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/events","assignees_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/assignees{/user}","branches_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/branches{/branch}","tags_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/tags","blobs_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/languages","stargazers_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/stargazers","contributors_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/contributors","subscribers_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/subscribers","subscription_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/subscription","commits_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/contents/{+path}","compare_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/merges","archive_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/downloads","issues_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/issues{/number}","pulls_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/labels{/name}","releases_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/releases{/id}","deployments_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/deployments","created_at":"2018-09-13T14:59:58Z","updated_at":"2018-09-13T15:19:49Z","pushed_at":"2018-09-13T15:00:00Z","git_url":"git://github.com/sample-test-organisation/sample-repo.git","ssh_url":"git@github.com:sample-test-organisation/sample-repo.git","clone_url":"https://github.com/sample-test-organisation/sample-repo.git","svn_url":"https://github.com/sample-test-organisation/sample-repo","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,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true}}],"url":"https://api.github.com/orgs/sample-test-organisation/migrations/25312","created_at":"2018-09-13T20:49:49.000+05:30","updated_at":"2018-09-13T20:49:49.000+05:30"} + diff --git a/github/tests/ReplayData/Organization.testGetMigrations.txt b/github/tests/ReplayData/Organization.testGetMigrations.txt new file mode 100644 index 00000000..763c5505 --- /dev/null +++ b/github/tests/ReplayData/Organization.testGetMigrations.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/orgs/sample-test-organisation +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 15:19:47 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', '1536855475'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', 'W/"1b018825113df112cbfdf5096ac86cfd"'), ('Last-Modified', 'Thu, 13 Sep 2018 09:21:05 GMT'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.063567'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1CD7:1FE1:13159D3:27509C2:5B9A8012')] +{"login":"sample-test-organisation","id":43235726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjM1NzI2","url":"https://api.github.com/orgs/sample-test-organisation","repos_url":"https://api.github.com/orgs/sample-test-organisation/repos","events_url":"https://api.github.com/orgs/sample-test-organisation/events","hooks_url":"https://api.github.com/orgs/sample-test-organisation/hooks","issues_url":"https://api.github.com/orgs/sample-test-organisation/issues","members_url":"https://api.github.com/orgs/sample-test-organisation/members{/member}","public_members_url":"https://api.github.com/orgs/sample-test-organisation/public_members{/member}","avatar_url":"https://avatars3.githubusercontent.com/u/43235726?v=4","description":null,"is_verified":false,"has_organization_projects":true,"has_repository_projects":true,"public_repos":1,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/sample-test-organisation","created_at":"2018-09-13T09:21:05Z","updated_at":"2018-09-13T09:21:05Z","type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":0,"collaborators":0,"billing_email":"tfv60722@nbzmr.com","plan":{"name":"free","space":976562499,"private_repos":0,"filled_seats":1,"seats":0},"default_repository_permission":"read","members_can_create_repositories":true,"two_factor_requirement_enabled":false} + +https +GET +api.github.com +None +/orgs/sample-test-organisation/migrations?per_page=1 +{'Accept': 'application/vnd.github.wyandotte-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 13 Sep 2018 15:16:03 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4908'), ('X-RateLimit-Reset', '1536851865'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', 'W/"b9e918c8c5de017cdd3f3badb9cd7268"'), ('X-GitHub-Media-Type', 'github.wyandotte-preview; format=json'), ('Link', '; rel="next", ; rel="last"'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('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-Runtime-rack', '0.107384'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'CC2C:1FE2:1A98BC4:31A75CC:5B9A7F32')] +[{"id":25311,"node_id":"MDk6TWlncmF0aW9uMjUzMTE=","owner":{"login":"sample-test-organisation","id":43235726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjM1NzI2","avatar_url":"https://avatars3.githubusercontent.com/u/43235726?v=4","gravatar_id":"","url":"https://api.github.com/users/sample-test-organisation","html_url":"https://github.com/sample-test-organisation","followers_url":"https://api.github.com/users/sample-test-organisation/followers","following_url":"https://api.github.com/users/sample-test-organisation/following{/other_user}","gists_url":"https://api.github.com/users/sample-test-organisation/gists{/gist_id}","starred_url":"https://api.github.com/users/sample-test-organisation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sample-test-organisation/subscriptions","organizations_url":"https://api.github.com/users/sample-test-organisation/orgs","repos_url":"https://api.github.com/users/sample-test-organisation/repos","events_url":"https://api.github.com/users/sample-test-organisation/events{/privacy}","received_events_url":"https://api.github.com/users/sample-test-organisation/received_events","type":"Organization","site_admin":false},"guid":"2f2dd1be-b767-11e8-917a-8ff981efcc40","state":"exported","lock_repositories":false,"exclude_attachments":false,"repositories":[{"id":148654765,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg2NTQ3NjU=","name":"sample-repo","full_name":"sample-test-organisation/sample-repo","owner":{"login":"sample-test-organisation","id":43235726,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjM1NzI2","avatar_url":"https://avatars3.githubusercontent.com/u/43235726?v=4","gravatar_id":"","url":"https://api.github.com/users/sample-test-organisation","html_url":"https://github.com/sample-test-organisation","followers_url":"https://api.github.com/users/sample-test-organisation/followers","following_url":"https://api.github.com/users/sample-test-organisation/following{/other_user}","gists_url":"https://api.github.com/users/sample-test-organisation/gists{/gist_id}","starred_url":"https://api.github.com/users/sample-test-organisation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sample-test-organisation/subscriptions","organizations_url":"https://api.github.com/users/sample-test-organisation/orgs","repos_url":"https://api.github.com/users/sample-test-organisation/repos","events_url":"https://api.github.com/users/sample-test-organisation/events{/privacy}","received_events_url":"https://api.github.com/users/sample-test-organisation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sample-test-organisation/sample-repo","description":null,"fork":false,"url":"https://api.github.com/repos/sample-test-organisation/sample-repo","forks_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/forks","keys_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/teams","hooks_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/hooks","issue_events_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/issues/events{/number}","events_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/events","assignees_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/assignees{/user}","branches_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/branches{/branch}","tags_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/tags","blobs_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/languages","stargazers_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/stargazers","contributors_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/contributors","subscribers_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/subscribers","subscription_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/subscription","commits_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/contents/{+path}","compare_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/merges","archive_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/downloads","issues_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/issues{/number}","pulls_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/labels{/name}","releases_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/releases{/id}","deployments_url":"https://api.github.com/repos/sample-test-organisation/sample-repo/deployments","created_at":"2018-09-13T14:59:58Z","updated_at":"2018-09-13T15:10:43Z","pushed_at":"2018-09-13T15:00:00Z","git_url":"git://github.com/sample-test-organisation/sample-repo.git","ssh_url":"git@github.com:sample-test-organisation/sample-repo.git","clone_url":"https://github.com/sample-test-organisation/sample-repo.git","svn_url":"https://github.com/sample-test-organisation/sample-repo","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,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true}}],"url":"https://api.github.com/orgs/sample-test-organisation/migrations/25311","archive_url":"https://api.github.com/orgs/sample-test-organisation/migrations/25311/archive","created_at":"2018-09-13T20:40:43.000+05:30","updated_at":"2018-09-13T20:40:54.000+05:30"}] +