-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement get_pr_diff for Pagure (#826)
Implement get_pr_diff for Pagure Needed for packit/packit-service#2271 TODO: test RELEASE NOTES BEGIN There is a new get_pr_files_diff method supported for Pagure. RELEASE NOTES END Reviewed-by: František Lachman <[email protected]>
- Loading branch information
Showing
7 changed files
with
271 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
tests/integration/pagure/test_data/test_pull_requests/PullRequests.test_pr_diff.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
_requre: | ||
DataTypes: 1 | ||
key_strategy: StorageKeysInspectSimple | ||
version_storage_file: 3 | ||
requests.sessions: | ||
send: | ||
GET: | ||
https://pagure.io/api/0/ogr-tests/pull-request/13/diffstats: | ||
- metadata: | ||
latency: 0.2961406707763672 | ||
module_call_list: | ||
- unittest.case | ||
- requre.record_and_replace | ||
- tests.integration.pagure.test_pull_requests | ||
- ogr.abstract | ||
- ogr.utils | ||
- ogr.abstract | ||
- ogr.services.pagure.pull_request | ||
- ogr.abstract | ||
- ogr.services.pagure.project | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- requests.sessions | ||
- requre.objects | ||
- requre.cassette | ||
- requests.sessions | ||
- send | ||
output: | ||
__store_indicator: 2 | ||
_content: | ||
README.md: | ||
lines_added: 5 | ||
lines_removed: 1 | ||
new_id: 3953698d00a5c8c8ef0582a05083a242beca4033 | ||
old_id: a40a52a2ba46ddf4f9a4ecd04b47f717573467a6 | ||
old_path: README.md | ||
status: M | ||
_next: null | ||
elapsed: 0.2 | ||
encoding: utf-8 | ||
headers: | ||
Connection: Keep-Alive | ||
Content-Length: '239' | ||
Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' | ||
https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; | ||
object-src 'none';base-uri 'self';img-src 'self' https:; | ||
Content-Type: application/json | ||
Date: Fri, 01 Nov 2019 13-36-03 GMT | ||
Keep-Alive: timeout=5, max=99 | ||
Referrer-Policy: same-origin | ||
Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 | ||
Python/3.6 | ||
Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiOGRjYjBkOTVmZWVhYTdjMjhjNmNkNWNhN2ZlZmFmNGE3ZjMxZDliMSJ9.GFnCeg.6mYem_Ppb-t6pkIsrmcLGfZk3jg; | ||
Expires=Fri, 12-Jan-2024 10:07:54 GMT; Secure; HttpOnly; Path=/ | ||
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: ALLOW-FROM https://pagure.io/ | ||
X-Xss-Protection: 1; mode=block | ||
raw: !!binary "" | ||
reason: OK | ||
status_code: 200 | ||
POST: | ||
https://pagure.io/api/0/-/whoami: | ||
- metadata: | ||
latency: 0.8561291694641113 | ||
module_call_list: | ||
- unittest.case | ||
- requre.record_and_replace | ||
- tests.integration.pagure.test_pull_requests | ||
- tests.integration.pagure.base | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.user | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- requests.sessions | ||
- requre.objects | ||
- requre.cassette | ||
- requests.sessions | ||
- send | ||
output: | ||
__store_indicator: 2 | ||
_content: | ||
username: lbarczio | ||
_next: null | ||
elapsed: 0.2 | ||
encoding: utf-8 | ||
headers: | ||
Connection: Upgrade, Keep-Alive | ||
Content-Length: '29' | ||
Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' | ||
https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; | ||
object-src 'none';base-uri 'self';img-src 'self' https:; | ||
Content-Type: application/json | ||
Date: Fri, 01 Nov 2019 13-36-03 GMT | ||
Keep-Alive: timeout=5, max=100 | ||
Referrer-Policy: same-origin | ||
Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 | ||
Python/3.6 | ||
Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiOGRjYjBkOTVmZWVhYTdjMjhjNmNkNWNhN2ZlZmFmNGE3ZjMxZDliMSJ9.GFnCeQ.AxPTspgeBuxKKhTR48bGrHZf2lE; | ||
Expires=Fri, 12-Jan-2024 10:07:53 GMT; Secure; HttpOnly; Path=/ | ||
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload | ||
Upgrade: h2,h2c | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: ALLOW-FROM https://pagure.io/ | ||
X-Xss-Protection: 1; mode=block | ||
raw: !!binary "" | ||
reason: OK | ||
status_code: 200 |
112 changes: 112 additions & 0 deletions
112
...integration/pagure/test_data/test_pull_requests/PullRequests.test_pr_diff_empty_diff.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
_requre: | ||
DataTypes: 1 | ||
key_strategy: StorageKeysInspectSimple | ||
version_storage_file: 3 | ||
requests.sessions: | ||
send: | ||
GET: | ||
https://pagure.io/api/0/ogr-tests/pull-request/6/diffstats: | ||
- metadata: | ||
latency: 0.2965199947357178 | ||
module_call_list: | ||
- unittest.case | ||
- requre.record_and_replace | ||
- tests.integration.pagure.test_pull_requests | ||
- ogr.abstract | ||
- ogr.utils | ||
- ogr.abstract | ||
- ogr.services.pagure.pull_request | ||
- ogr.abstract | ||
- ogr.services.pagure.project | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- requests.sessions | ||
- requre.objects | ||
- requre.cassette | ||
- requests.sessions | ||
- send | ||
output: | ||
__store_indicator: 2 | ||
_content: | ||
error: No statistics could be computed for this PR | ||
error_code: ENOPRSTATS | ||
_next: null | ||
elapsed: 0.2 | ||
encoding: utf-8 | ||
headers: | ||
Connection: close | ||
Content-Length: '92' | ||
Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' | ||
https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; | ||
object-src 'none';base-uri 'self';img-src 'self' https:; | ||
Content-Type: application/json | ||
Date: Fri, 01 Nov 2019 13-36-03 GMT | ||
Referrer-Policy: same-origin | ||
Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 | ||
Python/3.6 | ||
Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiMzU0YmExMTNlMWFhMGU0MzliZDFjN2UwZGY3ODg4OTBjODdhMzkwMSJ9.GFnGGw.MvcSSJ61ycB9FCodU3kj9hWZeGY; | ||
Expires=Fri, 12-Jan-2024 10:23:23 GMT; Secure; HttpOnly; Path=/ | ||
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: ALLOW-FROM https://pagure.io/ | ||
X-Xss-Protection: 1; mode=block | ||
raw: !!binary "" | ||
reason: BAD REQUEST | ||
status_code: 400 | ||
POST: | ||
https://pagure.io/api/0/-/whoami: | ||
- metadata: | ||
latency: 0.565004825592041 | ||
module_call_list: | ||
- unittest.case | ||
- requre.record_and_replace | ||
- tests.integration.pagure.test_pull_requests | ||
- tests.integration.pagure.base | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.user | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- ogr.abstract | ||
- ogr.services.pagure.service | ||
- requests.sessions | ||
- requre.objects | ||
- requre.cassette | ||
- requests.sessions | ||
- send | ||
output: | ||
__store_indicator: 2 | ||
_content: | ||
username: lbarczio | ||
_next: null | ||
elapsed: 0.2 | ||
encoding: utf-8 | ||
headers: | ||
Connection: Upgrade, Keep-Alive | ||
Content-Length: '29' | ||
Content-Security-Policy: default-src 'self';script-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne' | ||
https://apps.fedoraproject.org; style-src 'self' 'nonce-YqLDC0BS8d7iY8mKO7VtBbIne'; | ||
object-src 'none';base-uri 'self';img-src 'self' https:; | ||
Content-Type: application/json | ||
Date: Fri, 01 Nov 2019 13-36-03 GMT | ||
Keep-Alive: timeout=5, max=100 | ||
Referrer-Policy: same-origin | ||
Server: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 | ||
Python/3.6 | ||
Set-Cookie: pagure=eyJfcGVybWFuZW50Ijp0cnVlLCJjc3JmX3Rva2VuIjoiMzU0YmExMTNlMWFhMGU0MzliZDFjN2UwZGY3ODg4OTBjODdhMzkwMSJ9.GFnGGw.MvcSSJ61ycB9FCodU3kj9hWZeGY; | ||
Expires=Fri, 12-Jan-2024 10:23:23 GMT; Secure; HttpOnly; Path=/ | ||
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload | ||
Upgrade: h2,h2c | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: ALLOW-FROM https://pagure.io/ | ||
X-Xss-Protection: 1; mode=block | ||
raw: !!binary "" | ||
reason: OK | ||
status_code: 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters