Skip to content

Commit

Permalink
test: ✅ update test_semanticscholar.py with drop_unused_requests option
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnsilva committed Nov 17, 2023
1 parent ca36b07 commit 2741953
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 157,749 deletions.
38 changes: 19 additions & 19 deletions tests/data/test_empty_paginated_results.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
interactions:
- request:
body: null
body: ''
headers:
Accept:
accept:
- '*/*'
Accept-Encoding:
accept-encoding:
- gzip, deflate
Connection:
connection:
- keep-alive
User-Agent:
- python-requests/2.31.0
host:
- api.semanticscholar.org
user-agent:
- python-httpx/0.25.1
method: GET
uri: https://api.semanticscholar.org/graph/v1/paper/search?query=n0%20r3sult%20s3arch%20t3rm&fields=abstract,authors,citationCount,corpusId,externalIds,fieldsOfStudy,influentialCitationCount,isOpenAccess,journal,openAccessPdf,paperId,publicationDate,publicationTypes,publicationVenue,referenceCount,s2FieldsOfStudy,title,url,venue,year&offset=0&limit=100
response:
body:
string: '{"total": 0, "offset": 0}
content: '{"total": 0, "offset": 0}
'
'
headers:
Access-Control-Allow-Origin:
- '*'
Expand All @@ -27,28 +28,27 @@ interactions:
Content-Type:
- application/json
Date:
- Sun, 01 Oct 2023 20:52:10 GMT
- Thu, 16 Nov 2023 21:22:16 GMT
Via:
- 1.1 0e3b340d2469d5d03795669e20d22b7e.cloudfront.net (CloudFront)
- 1.1 2199b1b2895d8f15e09ac5a5c5b50dbc.cloudfront.net (CloudFront)
X-Amz-Cf-Id:
- 9T-u5B3WlBtHh0vdlJYdSntCzw-Af8fq1GIwjrDlHTEvKNghRqUkKg==
- C8DZAiXBBgkx-_M4WKH9pQc6cLPmzOWk5AmHgpf-pNm2Us0Zd8-72A==
X-Amz-Cf-Pop:
- GRU3-P4
- GIG51-P4
X-Cache:
- Miss from cloudfront
x-amz-apigw-id:
- MI9PJGlzvHcF5Uw=
- OgoxTEGuvHcEj1Q=
x-amzn-Remapped-Connection:
- keep-alive
x-amzn-Remapped-Content-Length:
- '26'
x-amzn-Remapped-Date:
- Sun, 01 Oct 2023 20:52:10 GMT
- Thu, 16 Nov 2023 21:22:16 GMT
x-amzn-Remapped-Server:
- gunicorn
x-amzn-RequestId:
- cd8e8299-426b-4f28-8df8-d149b364eb1f
status:
code: 200
message: OK
- b0482536-09c8-4237-a935-9e84fd128e9b
http_version: HTTP/1.1
status_code: 200
version: 1
54 changes: 1 addition & 53 deletions tests/data/test_get_paper_authors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,7 @@ interactions:
host:
- api.semanticscholar.org
user-agent:
- python-httpx/0.24.1
method: GET
uri: https://api.semanticscholar.org/graph/v1/paper/CorpusID:54599684/authors?&fields=affiliations,aliases,authorId,citationCount,externalIds,hIndex,homepage,name,paperCount,url&offset=0&limit=1000
response:
content: '{"offset": 0, "data": []}
'
headers:
Access-Control-Allow-Origin:
- '*'
Connection:
- keep-alive
Content-Length:
- '26'
Content-Type:
- application/json
Date:
- Wed, 13 Sep 2023 21:47:26 GMT
Via:
- 1.1 e8bd72d9a7c5eaf252aab1ed2d79e1a6.cloudfront.net (CloudFront)
X-Amz-Cf-Id:
- CZLCPQxKQFSfYBAvwFJleJKb1DUE2XB--R_vHypqCtrL7Tvl4_o08g==
X-Amz-Cf-Pop:
- EWR50-C1
X-Cache:
- Miss from cloudfront
x-amz-apigw-id:
- LNwdSGt_PHcFsOg=
x-amzn-Remapped-Connection:
- keep-alive
x-amzn-Remapped-Content-Length:
- '26'
x-amzn-Remapped-Date:
- Wed, 13 Sep 2023 21:47:26 GMT
x-amzn-Remapped-Server:
- gunicorn
x-amzn-RequestId:
- d22f9492-8add-4dc6-b0ff-f1d0cfbc5b17
http_version: HTTP/1.1
status_code: 200
- request:
body: ''
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
host:
- api.semanticscholar.org
user-agent:
- python-httpx/0.24.1
- python-httpx/0.25.1
method: GET
uri: https://api.semanticscholar.org/graph/v1/paper/10.2139/ssrn.2250500/authors?&fields=affiliations,aliases,authorId,citationCount,externalIds,hIndex,homepage,name,paperCount,url&offset=0&limit=1000
response:
Expand Down
54 changes: 1 addition & 53 deletions tests/data/test_get_recommended_papers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,7 @@ interactions:
host:
- api.semanticscholar.org
user-agent:
- python-httpx/0.24.1
method: GET
uri: https://api.semanticscholar.org/recommendations/v1/papers/forpaper/10.1145/3544585.3544600?&fields=abstract,authors,citationCount,corpusId,externalIds,fieldsOfStudy,influentialCitationCount,isOpenAccess,journal,openAccessPdf,paperId,publicationDate,publicationTypes,publicationVenue,referenceCount,s2FieldsOfStudy,title,url,venue,year&limit=100&from=recent
response:
content: '{"recommendedPapers": []}
'
headers:
Access-Control-Allow-Origin:
- '*'
Connection:
- keep-alive
Content-Length:
- '26'
Content-Type:
- application/json
Date:
- Wed, 13 Sep 2023 21:48:16 GMT
Via:
- 1.1 e6fc68fd040718147cda2e3ef6f63636.cloudfront.net (CloudFront)
X-Amz-Cf-Id:
- u9QHJPnmadXpFPZCPcyYMxU0I9ZUzn2AnZXJoFoeWpUYGSWrF22diA==
X-Amz-Cf-Pop:
- EWR50-C1
X-Cache:
- Miss from cloudfront
x-amz-apigw-id:
- LNwlGGa_vHcFvbw=
x-amzn-Remapped-Connection:
- keep-alive
x-amzn-Remapped-Content-Length:
- '26'
x-amzn-Remapped-Date:
- Wed, 13 Sep 2023 21:48:16 GMT
x-amzn-Remapped-Server:
- gunicorn
x-amzn-RequestId:
- 60ada209-bf3e-4179-b015-fd501391b74c
http_version: HTTP/1.1
status_code: 200
- request:
body: ''
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
host:
- api.semanticscholar.org
user-agent:
- python-httpx/0.24.1
- python-httpx/0.25.1
method: GET
uri: https://api.semanticscholar.org/recommendations/v1/papers/forpaper/10.2139/ssrn.2250500?&fields=abstract,authors,citationCount,corpusId,externalIds,fieldsOfStudy,influentialCitationCount,isOpenAccess,journal,openAccessPdf,paperId,publicationDate,publicationTypes,publicationVenue,referenceCount,s2FieldsOfStudy,title,url,venue,year&limit=100&from=recent
response:
Expand Down
56 changes: 1 addition & 55 deletions tests/data/test_get_recommended_papers_async.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,7 @@ interactions:
host:
- partner.semanticscholar.org
user-agent:
- python-httpx/0.24.1
x-api-key:
- C0lOxNwpbR2bJnuIFSjL5ilYOjeUa6mrENswCAd0
method: GET
uri: https://partner.semanticscholar.org/recommendations/v1/papers/forpaper/10.1145/3544585.3544600?&fields=abstract,authors,citationCount,corpusId,externalIds,fieldsOfStudy,influentialCitationCount,isOpenAccess,journal,openAccessPdf,paperId,publicationDate,publicationTypes,publicationVenue,referenceCount,s2FieldsOfStudy,title,url,venue,year&limit=100&from=recent
response:
content: '{"recommendedPapers": []}
'
headers:
Access-Control-Allow-Origin:
- '*'
Connection:
- keep-alive
Content-Length:
- '26'
Content-Type:
- application/json
Date:
- Wed, 13 Sep 2023 21:45:37 GMT
Via:
- 1.1 249557823ab8e41dec2ed10311f8ff98.cloudfront.net (CloudFront)
X-Amz-Cf-Id:
- dVi9CnkKNPaoOGAeaMFxu9ROYAO5POvh4bEuOeLRdqSoefEUH630SA==
X-Amz-Cf-Pop:
- EWR53-C1
X-Cache:
- Miss from cloudfront
x-amz-apigw-id:
- LNwMNEhEPHcFeeg=
x-amzn-Remapped-Connection:
- keep-alive
x-amzn-Remapped-Content-Length:
- '26'
x-amzn-Remapped-Date:
- Wed, 13 Sep 2023 21:45:37 GMT
x-amzn-Remapped-Server:
- gunicorn
x-amzn-RequestId:
- 017509db-6b64-4cf6-8963-271e8e8f6c93
http_version: HTTP/1.1
status_code: 200
- request:
body: ''
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
host:
- partner.semanticscholar.org
user-agent:
- python-httpx/0.24.1
- python-httpx/0.25.1
x-api-key:
- C0lOxNwpbR2bJnuIFSjL5ilYOjeUa6mrENswCAd0
method: GET
Expand Down
Loading

0 comments on commit 2741953

Please sign in to comment.