コード例 #1
0
    def __init__(self, **kwargs):
        self._adapter = adapter.Adapter()
        self._real_http = kwargs.pop('real_http', False)
        self._real_send = None

        if kwargs:
            raise TypeError('Unexpected Arguments: %s' % ', '.join(kwargs))
コード例 #2
0
ファイル: mocker.py プロジェクト: philvarner/requests-mock
    def __init__(self, **kwargs):
        case_sensitive = kwargs.pop('case_sensitive', self.case_sensitive)
        self._adapter = adapter.Adapter(case_sensitive=case_sensitive)

        self._real_http = kwargs.pop('real_http', False)
        self._last_send = None

        if kwargs:
            raise TypeError('Unexpected Arguments: %s' % ', '.join(kwargs))
コード例 #3
0
    def __init__(self, session=None, **kwargs):
        if session and not isinstance(session, requests.Session):
            raise TypeError("Only a requests.Session object can be mocked")

        self._mock_target = session or requests.Session
        self.case_sensitive = kwargs.pop('case_sensitive', self.case_sensitive)
        self._adapter = (kwargs.pop('adapter', None) or
                         adapter.Adapter(case_sensitive=self.case_sensitive))

        self.real_http = kwargs.pop('real_http', False)
        self._last_send = None

        if kwargs:
            raise TypeError('Unexpected Arguments: %s' % ', '.join(kwargs))