Content-Length: 272723 | pFad | http://github.com/Nasdaq/data-link-python/pull/16/commits/2b0f25d955a2b998352f060a36be62e50e7cf4bd

FE session-per-request to session-over-time by runawaycoast · Pull Request #16 · Nasdaq/data-link-python · GitHub
Skip to content

session-per-request to session-over-time #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test for session reuse
  • Loading branch information
runawaycoast committed Apr 6, 2022
commit 2b0f25d955a2b998352f060a36be62e50e7cf4bd
12 changes: 12 additions & 0 deletions test/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,15 @@ def test_build_request(self, request_method, mock):
'request-source-version': VERSION},
params={'per_page': 10, 'page': 2})
self.assertEqual(mock.call_args, expected)

def test_session_reuse(self):
session1 = connection.get_session()
session2 = connection.get_session()
areSessionsSame = session1 is session2

adapter1 = connection.get_session().get_adapter(ApiConfig.api_protocol)
adapter2 = connection.get_session().get_adapter(ApiConfig.api_protocol)
areAdaptersSame = adapter1 is adapter2

self.assertEqual(areAdaptersSame, True)
self.assertEqual(areSessionsSame, True)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Nasdaq/data-link-python/pull/16/commits/2b0f25d955a2b998352f060a36be62e50e7cf4bd

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy