MCPcopy Create free account
hub / github.com/EasyIME/PIME / _RequestProxy

Class _RequestProxy

python/python3/tornado/httpclient.py:735–754  ·  view source on GitHub ↗

Combines an object with a dictionary of defaults. Used internally by AsyncHTTPClient implementations.

Source from the content-addressed store, hash-verified

733
734
735class _RequestProxy(object):
736 """Combines an object with a dictionary of defaults.
737
738 Used internally by AsyncHTTPClient implementations.
739 """
740
741 def __init__(
742 self, request: HTTPRequest, defaults: Optional[Dict[str, Any]]
743 ) -> None:
744 self.request = request
745 self.defaults = defaults
746
747 def __getattr__(self, name: str) -> Any:
748 request_attr = getattr(self.request, name)
749 if request_attr is not None:
750 return request_attr
751 elif self.defaults is not None:
752 return self.defaults.get(name, None)
753 else:
754 return None
755
756
757def main() -> None:

Callers 7

test_request_setMethod · 0.90
test_default_setMethod · 0.90
test_both_setMethod · 0.90
test_neither_setMethod · 0.90
test_bad_attributeMethod · 0.90
test_defaults_noneMethod · 0.90
fetchMethod · 0.85

Calls

no outgoing calls

Tested by 6

test_request_setMethod · 0.72
test_default_setMethod · 0.72
test_both_setMethod · 0.72
test_neither_setMethod · 0.72
test_bad_attributeMethod · 0.72
test_defaults_noneMethod · 0.72