From c35b2e8938bb88f082cbaf74372a10f5a023f456 Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 11 Feb 2021 21:59:57 -0600 Subject: [PATCH] Update cassette for test using API.friends_ids --- cassettes/testfriendsids.json | 99 ----------------------------------- cassettes/testfriendsids.yaml | 77 +++++++++++++++++++++++++++ tests/test_api.py | 2 +- 3 files changed, 78 insertions(+), 100 deletions(-) delete mode 100644 cassettes/testfriendsids.json create mode 100644 cassettes/testfriendsids.yaml diff --git a/cassettes/testfriendsids.json b/cassettes/testfriendsids.json deleted file mode 100644 index 76dfca6..0000000 --- a/cassettes/testfriendsids.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "version": 1, - "interactions": [ - { - "request": { - "method": "GET", - "uri": "https://api.twitter.com/1.1/friends/ids.json?id=TweepyDev", - "body": null, - "headers": { - "Host": [ - "api.twitter.com" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "content-type": [ - "application/json;charset=utf-8" - ], - "x-xss-protection": [ - "1; mode=block; report=https://twitter.com/i/xss_report" - ], - "x-content-type-options": [ - "nosniff" - ], - "expires": [ - "Tue, 31 Mar 1981 05:00:00 GMT" - ], - "last-modified": [ - "Sat, 13 Jul 2019 02:27:40 GMT" - ], - "server": [ - "tsa_b" - ], - "cache-control": [ - "no-cache, no-store, must-revalidate, pre-check=0, post-check=0" - ], - "x-connection-hash": [ - "0a8862158bd0fce3d575c2db4305d1d1" - ], - "x-rate-limit-limit": [ - "15" - ], - "x-frame-options": [ - "SAMEORIGIN" - ], - "x-rate-limit-remaining": [ - "2" - ], - "pragma": [ - "no-cache" - ], - "date": [ - "Sat, 13 Jul 2019 02:27:40 GMT" - ], - "status": [ - "200 OK" - ], - "set-cookie": [ - "personalization_id=\"v1_zyS5wV241vdS6+8+mkqrdA==\"; Max-Age=63072000; Expires=Mon, 12 Jul 2021 02:27:40 GMT; Path=/; Domain=.twitter.com", - "lang=en; Path=/", - "guest_id=v1%3A156298486059433631; Max-Age=63072000; Expires=Mon, 12 Jul 2021 02:27:40 GMT; Path=/; Domain=.twitter.com" - ], - "x-access-level": [ - "read-write-directmessages" - ], - "x-twitter-response-tags": [ - "BouncerCompliant" - ], - "x-transaction": [ - "005fd00800a63868" - ], - "strict-transport-security": [ - "max-age=631138519" - ], - "content-disposition": [ - "attachment; filename=json.json" - ], - "content-length": [ - "131" - ], - "x-response-time": [ - "20" - ], - "x-rate-limit-reset": [ - "1562984889" - ] - }, - "body": { - "string": "{\"ids\":[6253282,2244994945],\"next_cursor\":0,\"next_cursor_str\":\"0\",\"previous_cursor\":0,\"previous_cursor_str\":\"0\",\"total_count\":null}" - } - } - } - ] -} \ No newline at end of file diff --git a/cassettes/testfriendsids.yaml b/cassettes/testfriendsids.yaml new file mode 100644 index 0000000..1be1794 --- /dev/null +++ b/cassettes/testfriendsids.yaml @@ -0,0 +1,77 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.25.1 + method: GET + uri: https://api.twitter.com/1.1/friends/ids.json?screen_name=TweepyDev + response: + body: + string: !!binary | + H4sIAAAAAAAAAFzKwQrCMAyA4XfJOYcmTZNmryIyZO4wGKusrQjDd9fj9Ph//Acs9wrDJSdTd1dn + ja5CSmhZxQkpmbFbRpIUo7oyWgpROagIqzFxJlROkTMjs4i7uKQrwja/2jj1vZYdhvDTY21fgwAI + j31+LqXX8/lnp7uVdlvHqfStwbD1dX1/AAAA//8DACleTB7DAAAA + headers: + cache-control: + - no-cache, no-store, must-revalidate, pre-check=0, post-check=0 + content-disposition: + - attachment; filename=json.json + content-encoding: + - gzip + content-length: + - '153' + content-type: + - application/json;charset=utf-8 + date: + - Fri, 12 Feb 2021 03:58:54 GMT + expires: + - Tue, 31 Mar 1981 05:00:00 GMT + last-modified: + - Fri, 12 Feb 2021 03:58:54 GMT + pragma: + - no-cache + server: + - tsa_b + set-cookie: + - personalization_id="v1_Ckle6m0DOIQ6zRa+jgLJUg=="; Max-Age=63072000; Expires=Sun, + 12 Feb 2023 03:58:54 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None + - lang=en; Path=/ + - guest_id=v1%3A161310233437496974; Max-Age=63072000; Expires=Sun, 12 Feb 2023 + 03:58:54 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None + status: + - 200 OK + strict-transport-security: + - max-age=631138519 + x-access-level: + - read-write-directmessages + x-connection-hash: + - c1e0c06b1a3689373d6a1ecdad8dbd97 + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-rate-limit-limit: + - '15' + x-rate-limit-remaining: + - '13' + x-rate-limit-reset: + - '1613103206' + x-response-time: + - '22' + x-transaction: + - 004d8a93006dcf9b + x-twitter-response-tags: + - BouncerCompliant + x-xss-protection: + - '0' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_api.py b/tests/test_api.py index 37c9aaa..7f21215 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -168,7 +168,7 @@ class TweepyAPITests(TweepyTestCase): self.assertTrue(isinstance(source, Friendship)) self.assertTrue(isinstance(target, Friendship)) - @tape.use_cassette('testfriendsids.json') + @tape.use_cassette('testfriendsids.yaml', serializer='yaml') def testfriendsids(self): self.api.friends_ids(screen_name=username) -- 2.25.1