mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -31,43 +31,49 @@ def command(func):
|
|||
|
||||
|
||||
class Timeouts(object):
|
||||
|
||||
def __init__(self, session):
|
||||
self.session = session
|
||||
self._script = 30
|
||||
self._load = 0
|
||||
self._implicit_wait = 0
|
||||
|
||||
def _set_timeouts(self, name, value):
|
||||
body = {"type": name,
|
||||
"ms": value * 1000}
|
||||
return self.session.send_command("POST", "timeouts", body)
|
||||
def _get(self, key=None):
|
||||
timeouts = self.session.send_session_command("GET", "timeouts")
|
||||
if key is not None:
|
||||
return timeouts[key]
|
||||
return timeouts
|
||||
|
||||
def _set(self, key, secs):
|
||||
body = {key: secs * 1000}
|
||||
timeouts = self.session.send_session_command("POST", "timeouts", body)
|
||||
return timeouts[key]
|
||||
|
||||
@property
|
||||
def script(self):
|
||||
return self._script
|
||||
return self._get("script")
|
||||
|
||||
@script.setter
|
||||
def script(self, value):
|
||||
self._set_timeouts("script", value)
|
||||
self._script = value
|
||||
def script(self, secs):
|
||||
return self._set("script", secs)
|
||||
|
||||
@property
|
||||
def load(self):
|
||||
return self._load
|
||||
def page_load(self):
|
||||
return self._get("pageLoad")
|
||||
|
||||
@load.setter
|
||||
def set_load(self, value):
|
||||
self._set_timeouts("page load", value)
|
||||
self._script = value
|
||||
@page_load.setter
|
||||
def page_load(self, secs):
|
||||
return self._set("pageLoad", secs)
|
||||
|
||||
@property
|
||||
def implicit_wait(self):
|
||||
return self._implicit_wait
|
||||
def implicit(self):
|
||||
return self._get("implicit")
|
||||
|
||||
@implicit_wait.setter
|
||||
def implicit_wait(self, value):
|
||||
self._set_timeouts("implicit wait", value)
|
||||
self._implicit_wait = value
|
||||
@implicit.setter
|
||||
def implicit(self, secs):
|
||||
return self._set("implicit", secs)
|
||||
|
||||
def __str__(self):
|
||||
name = "%s.%s" % (self.__module__, self.__class__.__name__)
|
||||
return "<%s script=%d, load=%d, implicit=%d>" % \
|
||||
(name, self.script, self.page_load, self.implicit)
|
||||
|
||||
|
||||
class ActionSequence(object):
|
||||
|
@ -83,26 +89,30 @@ class ActionSequence(object):
|
|||
.key_up("a") \
|
||||
.perform()
|
||||
"""
|
||||
def __init__(self, session, action_type, input_id):
|
||||
def __init__(self, session, action_type, input_id, pointer_params=None):
|
||||
"""Represents a sequence of actions of one type for one input source.
|
||||
|
||||
:param session: WebDriver session.
|
||||
:param action_type: Action type; may be "none", "key", or "pointer".
|
||||
:param input_id: ID of input source.
|
||||
:param pointer_params: Optional dictionary of pointer parameters.
|
||||
"""
|
||||
self.session = session
|
||||
# TODO take advantage of remote end generating uuid
|
||||
self._id = input_id
|
||||
self._type = action_type
|
||||
self._actions = []
|
||||
self._pointer_params = pointer_params
|
||||
|
||||
@property
|
||||
def dict(self):
|
||||
return {
|
||||
"type": self._type,
|
||||
"id": self._id,
|
||||
"actions": self._actions,
|
||||
d = {
|
||||
"type": self._type,
|
||||
"id": self._id,
|
||||
"actions": self._actions,
|
||||
}
|
||||
if self._pointer_params is not None:
|
||||
d["parameters"] = self._pointer_params
|
||||
return d
|
||||
|
||||
@command
|
||||
def perform(self):
|
||||
|
@ -112,6 +122,47 @@ class ActionSequence(object):
|
|||
def _key_action(self, subtype, value):
|
||||
self._actions.append({"type": subtype, "value": value})
|
||||
|
||||
def _pointer_action(self, subtype, button):
|
||||
self._actions.append({"type": subtype, "button": button})
|
||||
|
||||
def pointer_move(self, x, y, duration=None, origin=None):
|
||||
"""Queue a pointerMove action.
|
||||
|
||||
:param x: Destination x-axis coordinate of pointer in CSS pixels.
|
||||
:param y: Destination y-axis coordinate of pointer in CSS pixels.
|
||||
:param duration: Number of milliseconds over which to distribute the
|
||||
move. If None, remote end defaults to 0.
|
||||
:param origin: Origin of coordinates, either "viewport", "pointer" or
|
||||
an Element. If None, remote end defaults to "viewport".
|
||||
"""
|
||||
action = {
|
||||
"type": "pointerMove",
|
||||
"x": x,
|
||||
"y": y
|
||||
}
|
||||
if duration is not None:
|
||||
action["duration"] = duration
|
||||
if origin is not None:
|
||||
action["origin"] = origin if isinstance(origin, basestring) else origin.json()
|
||||
self._actions.append(action)
|
||||
return self
|
||||
|
||||
def pointer_up(self, button):
|
||||
"""Queue a pointerUp action for `button`.
|
||||
|
||||
:param button: Pointer button to perform action with.
|
||||
"""
|
||||
self._pointer_action("pointerUp", button)
|
||||
return self
|
||||
|
||||
def pointer_down(self, button):
|
||||
"""Queue a pointerDown action for `button`.
|
||||
|
||||
:param button: Pointer button to perform action with.
|
||||
"""
|
||||
self._pointer_action("pointerDown", button)
|
||||
return self
|
||||
|
||||
def key_up(self, value):
|
||||
"""Queue a keyUp action for `value`.
|
||||
|
||||
|
@ -152,11 +203,11 @@ class Actions(object):
|
|||
``ActionSequence.dict``.
|
||||
"""
|
||||
body = {"actions": [] if actions is None else actions}
|
||||
return self.session.send_command("POST", "actions", body)
|
||||
return self.session.send_session_command("POST", "actions", body)
|
||||
|
||||
@command
|
||||
def release(self):
|
||||
return self.session.send_command("DELETE", "actions")
|
||||
return self.session.send_session_command("DELETE", "actions")
|
||||
|
||||
def sequence(self, *args, **kwargs):
|
||||
"""Return an empty ActionSequence of the designated type.
|
||||
|
@ -172,31 +223,31 @@ class Window(object):
|
|||
@property
|
||||
@command
|
||||
def size(self):
|
||||
resp = self.session.send_command("GET", "window/size")
|
||||
resp = self.session.send_session_command("GET", "window/rect")
|
||||
return (resp["width"], resp["height"])
|
||||
|
||||
@size.setter
|
||||
@command
|
||||
def size(self, (width, height)):
|
||||
body = {"width": width, "height": height}
|
||||
self.session.send_command("POST", "window/size", body)
|
||||
self.session.send_session_command("POST", "window/rect", body)
|
||||
|
||||
@property
|
||||
@command
|
||||
def position(self):
|
||||
resp = self.session.send_command("GET", "window/position")
|
||||
resp = self.session.send_session_command("GET", "window/rect")
|
||||
return (resp["x"], resp["y"])
|
||||
|
||||
@position.setter
|
||||
@command
|
||||
def position(self, (x, y)):
|
||||
body = {"x": x, "y": y}
|
||||
self.session.send_command("POST", "window/position", body)
|
||||
self.session.send_session_command("POST", "window/rect", body)
|
||||
|
||||
@property
|
||||
@command
|
||||
def maximize(self):
|
||||
return self.session.send_command("POST", "window/maximize")
|
||||
return self.session.send_session_command("POST", "window/maximize")
|
||||
|
||||
|
||||
class Find(object):
|
||||
|
@ -213,7 +264,7 @@ class Find(object):
|
|||
body = {"using": strategy,
|
||||
"value": selector}
|
||||
|
||||
data = self.session.send_command("POST", route, body, key="value")
|
||||
data = self.session.send_session_command("POST", route, body)
|
||||
|
||||
if all:
|
||||
rv = [self.session._element(item) for item in data]
|
||||
|
@ -228,7 +279,7 @@ class Cookies(object):
|
|||
self.session = session
|
||||
|
||||
def __getitem__(self, name):
|
||||
self.session.send_command("GET", "cookie/%s" % name, {}, key="value")
|
||||
self.session.send_session_command("GET", "cookie/%s" % name, {})
|
||||
|
||||
def __setitem__(self, name, value):
|
||||
cookie = {"name": name,
|
||||
|
@ -238,7 +289,7 @@ class Cookies(object):
|
|||
cookie["value"] = value
|
||||
elif hasattr(value, "value"):
|
||||
cookie["value"] = value.value
|
||||
self.session.send_command("POST", "cookie/%s" % name, {}, key="value")
|
||||
self.session.send_session_command("POST", "cookie/%s" % name, {})
|
||||
|
||||
|
||||
class UserPrompt(object):
|
||||
|
@ -247,32 +298,30 @@ class UserPrompt(object):
|
|||
|
||||
@command
|
||||
def dismiss(self):
|
||||
self.session.send_command("POST", "alert/dismiss")
|
||||
self.session.send_session_command("POST", "alert/dismiss")
|
||||
|
||||
@command
|
||||
def accept(self):
|
||||
self.session.send_command("POST", "alert/accept")
|
||||
self.session.send_session_command("POST", "alert/accept")
|
||||
|
||||
@property
|
||||
@command
|
||||
def text(self):
|
||||
return self.session.send_command("GET", "alert/text", key="value")
|
||||
return self.session.send_session_command("GET", "alert/text")
|
||||
|
||||
@text.setter
|
||||
@command
|
||||
def text(self, value):
|
||||
body = {"value": list(value)}
|
||||
self.session.send_command("POST", "alert/text", body=body)
|
||||
self.session.send_session_command("POST", "alert/text", body=body)
|
||||
|
||||
|
||||
class Session(object):
|
||||
def __init__(self, host, port, url_prefix="/", desired_capabilities=None,
|
||||
required_capabilities=None, timeout=transport.HTTP_TIMEOUT,
|
||||
extension=None):
|
||||
def __init__(self, host, port, url_prefix="/", capabilities=None,
|
||||
timeout=None, extension=None):
|
||||
self.transport = transport.HTTPWireProtocol(
|
||||
host, port, url_prefix, timeout=timeout)
|
||||
self.desired_capabilities = desired_capabilities
|
||||
self.required_capabilities = required_capabilities
|
||||
self.capabilities = capabilities
|
||||
self.session_id = None
|
||||
self.timeouts = None
|
||||
self.window = None
|
||||
|
@ -303,28 +352,23 @@ class Session(object):
|
|||
|
||||
body = {}
|
||||
|
||||
caps = {}
|
||||
if self.desired_capabilities is not None:
|
||||
caps["desiredCapabilities"] = self.desired_capabilities
|
||||
if self.required_capabilities is not None:
|
||||
caps["requiredCapabilities"] = self.required_capabilities
|
||||
#body["capabilities"] = caps
|
||||
body = caps
|
||||
if self.capabilities is not None:
|
||||
body["capabilities"] = self.capabilities
|
||||
|
||||
response = self.transport.send("POST", "session", body=body)
|
||||
self.session_id = response.body["value"]["sessionId"]
|
||||
value = self.send_command("POST", "session", body=body)
|
||||
self.session_id = value["sessionId"]
|
||||
|
||||
if self.extension_cls:
|
||||
self.extension = self.extension_cls(self)
|
||||
|
||||
return response.body["value"]
|
||||
return value
|
||||
|
||||
def end(self):
|
||||
if self.session_id is None:
|
||||
return
|
||||
|
||||
url = "session/%s" % self.session_id
|
||||
self.transport.send("DELETE", url)
|
||||
self.send_command("DELETE", url)
|
||||
|
||||
self.session_id = None
|
||||
self.timeouts = None
|
||||
|
@ -332,53 +376,58 @@ class Session(object):
|
|||
self.find = None
|
||||
self.extension = None
|
||||
|
||||
def send_raw_command(self, method, url, body=None, headers=None):
|
||||
"""Send a command to the remote end.
|
||||
|
||||
:param method: HTTP method to use in request
|
||||
:param url: "command part" of the requests URL path
|
||||
:param body: body of the HTTP request
|
||||
:param headers: Additional headers to include in the HTTP request
|
||||
|
||||
:return: an instance of wdclient.Response describing the HTTP response
|
||||
received from the remote end
|
||||
def send_command(self, method, url, body=None):
|
||||
"""
|
||||
url = urlparse.urljoin("session/%s/" % self.session_id, url)
|
||||
return self.transport.send(method, url, body, headers)
|
||||
Send a command to the remote end and validate its success.
|
||||
|
||||
def send_command(self, method, url, body=None, key=None):
|
||||
"""Send a command to the remote end and validate its success.
|
||||
:param method: HTTP method to use in request.
|
||||
:param uri: "Command part" of the HTTP request URL,
|
||||
e.g. `window/rect`.
|
||||
:param body: Optional body of the HTTP request.
|
||||
|
||||
:param method: HTTP method to use in request
|
||||
:param url: "command part" of the requests URL path
|
||||
:param body: body of the HTTP request
|
||||
:param key: (deprecated) when specified, this string value will be used
|
||||
to de-reference the HTTP response body following JSON parsing
|
||||
:return: `None` if the HTTP response body was empty, otherwise
|
||||
the result of parsing the body as JSON.
|
||||
|
||||
:return: None if the HTTP response body was empty, otherwise the
|
||||
result of parsing the HTTP response body as JSON
|
||||
:raises error.WebDriverException: If the remote end returns
|
||||
an error.
|
||||
"""
|
||||
response = self.transport.send(method, url, body)
|
||||
value = response.body["value"]
|
||||
|
||||
if response.status != 200:
|
||||
cls = error.get(value.get("error"))
|
||||
raise cls(value.get("message"))
|
||||
|
||||
return value
|
||||
|
||||
def send_session_command(self, method, uri, body=None):
|
||||
"""
|
||||
Send a command to an established session and validate its success.
|
||||
|
||||
:param method: HTTP method to use in request.
|
||||
:param url: "Command part" of the HTTP request URL,
|
||||
e.g. `window/rect`.
|
||||
:param body: Optional body of the HTTP request. Must be JSON
|
||||
serialisable.
|
||||
|
||||
:return: `None` if the HTTP response body was empty, otherwise
|
||||
the result of parsing the body as JSON.
|
||||
|
||||
:raises error.SessionNotCreatedException: If there is no active
|
||||
session.
|
||||
:raises error.WebDriverException: If the remote end returns
|
||||
an error.
|
||||
"""
|
||||
if self.session_id is None:
|
||||
raise error.SessionNotCreatedException()
|
||||
|
||||
response = self.send_raw_command(method, url, body)
|
||||
|
||||
if response.status != 200:
|
||||
cls = error.get(response.body["value"].get("error"))
|
||||
raise cls(response.body["value"].get("message"))
|
||||
|
||||
if key is not None:
|
||||
response.body = response.body[key]
|
||||
if not response.body:
|
||||
response.body = None
|
||||
|
||||
return response.body
|
||||
url = urlparse.urljoin("session/%s/" % self.session_id, uri)
|
||||
return self.send_command(method, url, body)
|
||||
|
||||
@property
|
||||
@command
|
||||
def url(self):
|
||||
return self.send_command("GET", "url", key="value")
|
||||
return self.send_session_command("GET", "url")
|
||||
|
||||
@url.setter
|
||||
@command
|
||||
|
@ -386,35 +435,35 @@ class Session(object):
|
|||
if urlparse.urlsplit(url).netloc is None:
|
||||
return self.url(url)
|
||||
body = {"url": url}
|
||||
return self.send_command("POST", "url", body)
|
||||
return self.send_session_command("POST", "url", body)
|
||||
|
||||
@command
|
||||
def back(self):
|
||||
return self.send_command("POST", "back")
|
||||
return self.send_session_command("POST", "back")
|
||||
|
||||
@command
|
||||
def forward(self):
|
||||
return self.send_command("POST", "forward")
|
||||
return self.send_session_command("POST", "forward")
|
||||
|
||||
@command
|
||||
def refresh(self):
|
||||
return self.send_command("POST", "refresh")
|
||||
return self.send_session_command("POST", "refresh")
|
||||
|
||||
@property
|
||||
@command
|
||||
def title(self):
|
||||
return self.send_command("GET", "title", key="value")
|
||||
return self.send_session_command("GET", "title")
|
||||
|
||||
@property
|
||||
@command
|
||||
def window_handle(self):
|
||||
return self.send_command("GET", "window", key="value")
|
||||
return self.send_session_command("GET", "window")
|
||||
|
||||
@window_handle.setter
|
||||
@command
|
||||
def window_handle(self, handle):
|
||||
body = {"handle": handle}
|
||||
return self.send_command("POST", "window", body=body)
|
||||
return self.send_session_command("POST", "window", body=body)
|
||||
|
||||
def switch_frame(self, frame):
|
||||
if frame == "parent":
|
||||
|
@ -427,21 +476,21 @@ class Session(object):
|
|||
else:
|
||||
body = {"id": frame}
|
||||
|
||||
return self.send_command("POST", url, body)
|
||||
return self.send_session_command("POST", url, body)
|
||||
|
||||
@command
|
||||
def close(self):
|
||||
return self.send_command("DELETE", "window")
|
||||
return self.send_session_command("DELETE", "window")
|
||||
|
||||
@property
|
||||
@command
|
||||
def handles(self):
|
||||
return self.send_command("GET", "window/handles", key="value")
|
||||
return self.send_session_command("GET", "window/handles")
|
||||
|
||||
@property
|
||||
@command
|
||||
def active_element(self):
|
||||
data = self.send_command("GET", "element/active", key="value")
|
||||
data = self.send_session_command("GET", "element/active")
|
||||
if data is not None:
|
||||
return self._element(data)
|
||||
|
||||
|
@ -458,7 +507,7 @@ class Session(object):
|
|||
url = "cookie"
|
||||
else:
|
||||
url = "cookie/%s" % name
|
||||
return self.send_command("GET", url, {}, key="value")
|
||||
return self.send_session_command("GET", url, {})
|
||||
|
||||
@command
|
||||
def set_cookie(self, name, value, path=None, domain=None, secure=None, expiry=None):
|
||||
|
@ -472,14 +521,14 @@ class Session(object):
|
|||
body["secure"] = secure
|
||||
if expiry is not None:
|
||||
body["expiry"] = expiry
|
||||
self.send_command("POST", "cookie", {"cookie": body})
|
||||
self.send_session_command("POST", "cookie", {"cookie": body})
|
||||
|
||||
def delete_cookie(self, name=None):
|
||||
if name is None:
|
||||
url = "cookie"
|
||||
else:
|
||||
url = "cookie/%s" % name
|
||||
self.send_command("DELETE", url, {}, key="value")
|
||||
self.send_session_command("DELETE", url, {})
|
||||
|
||||
#[...]
|
||||
|
||||
|
@ -492,7 +541,7 @@ class Session(object):
|
|||
"script": script,
|
||||
"args": args
|
||||
}
|
||||
return self.send_command("POST", "execute", body, key="value")
|
||||
return self.send_session_command("POST", "execute/sync", body)
|
||||
|
||||
@command
|
||||
def execute_async_script(self, script, args=None):
|
||||
|
@ -503,13 +552,13 @@ class Session(object):
|
|||
"script": script,
|
||||
"args": args
|
||||
}
|
||||
return self.send_command("POST", "execute_async", body, key="value")
|
||||
return self.send_session_command("POST", "execute/async", body)
|
||||
|
||||
#[...]
|
||||
|
||||
@command
|
||||
def screenshot(self):
|
||||
return self.send_command("GET", "screenshot", key="value")
|
||||
return self.send_session_command("GET", "screenshot")
|
||||
|
||||
|
||||
class Element(object):
|
||||
|
@ -519,35 +568,32 @@ class Element(object):
|
|||
assert id not in self.session._element_cache
|
||||
self.session._element_cache[self.id] = self
|
||||
|
||||
def send_element_command(self, method, uri, body=None):
|
||||
url = "element/%s/%s" % (self.id, uri)
|
||||
return self.session.send_session_command(method, url, body)
|
||||
|
||||
def json(self):
|
||||
return {element_key: self.id}
|
||||
|
||||
@property
|
||||
def session_id(self):
|
||||
return self.session.session_id
|
||||
|
||||
def url(self, suffix):
|
||||
return "element/%s/%s" % (self.id, suffix)
|
||||
|
||||
@command
|
||||
def find_element(self, strategy, selector):
|
||||
body = {"using": strategy,
|
||||
"value": selector}
|
||||
|
||||
elem = self.session.send_command("POST", self.url("element"), body, key="value")
|
||||
elem = self.send_element_command("POST", "element", body)
|
||||
return self.session.element(elem)
|
||||
|
||||
@command
|
||||
def click(self):
|
||||
self.session.send_command("POST", self.url("click"), {})
|
||||
self.send_element_command("POST", "click", {})
|
||||
|
||||
@command
|
||||
def tap(self):
|
||||
self.session.send_command("POST", self.url("tap"), {})
|
||||
self.send_element_command("POST", "tap", {})
|
||||
|
||||
@command
|
||||
def clear(self):
|
||||
self.session.send_command("POST", self.url("clear"), {})
|
||||
self.send_element_command("POST", self.url("clear"), {})
|
||||
|
||||
@command
|
||||
def send_keys(self, keys):
|
||||
|
@ -555,32 +601,31 @@ class Element(object):
|
|||
keys = [char for char in keys]
|
||||
|
||||
body = {"value": keys}
|
||||
|
||||
return self.session.send_command("POST", self.url("value"), body)
|
||||
return self.send_element_command("POST", "value", body)
|
||||
|
||||
@property
|
||||
@command
|
||||
def text(self):
|
||||
return self.session.send_command("GET", self.url("text"), key="value")
|
||||
return self.send_element_command("GET", "text")
|
||||
|
||||
@property
|
||||
@command
|
||||
def name(self):
|
||||
return self.session.send_command("GET", self.url("name"), key="value")
|
||||
return self.send_element_command("GET", "name")
|
||||
|
||||
@command
|
||||
def style(self, property_name):
|
||||
return self.session.send_command("GET", self.url("css/%s" % property_name), key="value")
|
||||
return self.send_element_command("GET", "css/%s" % property_name)
|
||||
|
||||
@property
|
||||
@command
|
||||
def rect(self):
|
||||
return self.session.send_command("GET", self.url("rect"))
|
||||
return self.send_element_command("GET", "rect")
|
||||
|
||||
@command
|
||||
def property(self, name):
|
||||
return self.session.send_command("GET", self.url("property/%s" % name), key="value")
|
||||
return self.send_element_command("GET", "property/%s" % name)
|
||||
|
||||
@command
|
||||
def attribute(self, name):
|
||||
return self.session.send_command("GET", self.url("attribute/%s" % name), key="value")
|
||||
return self.send_element_command("GET", "attribute/%s" % name)
|
||||
|
|
|
@ -6,8 +6,6 @@ import httplib
|
|||
import json
|
||||
import urlparse
|
||||
|
||||
HTTP_TIMEOUT = 5
|
||||
|
||||
class Response(object):
|
||||
"""Describes an HTTP response received from a remote en"Describes an HTTP
|
||||
response received from a remote end whose body has been read and parsed as
|
||||
|
@ -19,8 +17,8 @@ class Response(object):
|
|||
def __repr__(self):
|
||||
return "wdclient.Response(status=%d, body=%s)" % (self.status, self.body)
|
||||
|
||||
@staticmethod
|
||||
def from_http_response(http_response):
|
||||
@classmethod
|
||||
def from_http_response(cls, http_response):
|
||||
status = http_response.status
|
||||
body = http_response.read()
|
||||
|
||||
|
@ -45,14 +43,14 @@ class Response(object):
|
|||
# with a key `value` set to the JSON Serialization of data.
|
||||
assert "value" in body
|
||||
|
||||
return Response(status, body)
|
||||
return cls(status, body)
|
||||
|
||||
class HTTPWireProtocol(object):
|
||||
"""Transports messages (commands and responses) over the WebDriver
|
||||
wire protocol.
|
||||
"""
|
||||
|
||||
def __init__(self, host, port, url_prefix="/", timeout=HTTP_TIMEOUT):
|
||||
def __init__(self, host, port, url_prefix="/", timeout=None):
|
||||
"""Construct interface for communicating with the remote server.
|
||||
|
||||
:param url: URL of remote WebDriver server.
|
||||
|
@ -94,8 +92,12 @@ class HTTPWireProtocol(object):
|
|||
|
||||
url = self.url_prefix + url
|
||||
|
||||
kwargs = {}
|
||||
if self._timeout is not None:
|
||||
kwargs["timeout"] = self._timeout
|
||||
|
||||
conn = httplib.HTTPConnection(
|
||||
self.host, self.port, strict=True, timeout=self._timeout)
|
||||
self.host, self.port, strict=True, **kwargs)
|
||||
conn.request(method, url, body, headers)
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue