Add integration tests for requests with proxy param

This commit is contained in:
ngosang
2023-05-23 22:13:52 +02:00
parent efaa5f31b6
commit 3c97c9603a
5 changed files with 109 additions and 11 deletions

View File

@@ -25,7 +25,8 @@ class SessionsStorage:
def __init__(self):
self.sessions = {}
def create(self, session_id: Optional[str] = None, proxyconf: Optional[dict] = None, force_new: Optional[bool] = False) -> Tuple[Session, bool]:
def create(self, session_id: Optional[str] = None, proxy: Optional[dict] = None,
force_new: Optional[bool] = False) -> Tuple[Session, bool]:
"""create creates new instance of WebDriver if necessary,
assign defined (or newly generated) session_id to the instance
and returns the session object. If a new session has been created
@@ -44,7 +45,7 @@ class SessionsStorage:
if self.exists(session_id):
return self.sessions[session_id], False
driver = utils.get_webdriver(proxyconf=proxyconf)
driver = utils.get_webdriver(proxy)
created_at = datetime.now()
session = Session(session_id, driver, created_at)