當前位置: 首頁>>代碼示例>>Python>>正文


Python moves.http_client方法代碼示例

本文整理匯總了Python中six.moves.http_client方法的典型用法代碼示例。如果您正苦於以下問題:Python moves.http_client方法的具體用法?Python moves.http_client怎麽用?Python moves.http_client使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在six.moves的用法示例。


在下文中一共展示了moves.http_client方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: debug

# 需要導入模塊: from six import moves [as 別名]
# 或者: from six.moves import http_client [as 別名]
def debug(self, value):
        """Debug status

        :param value: The debug status, True or False.
        :type: bool
        """
        self.__debug = value
        if self.__debug:
            # if debug status is True, turn on debug logging
            for _, logger in six.iteritems(self.logger):
                logger.setLevel(logging.DEBUG)
            # turn on httplib debug
            httplib.HTTPConnection.debuglevel = 1
        else:
            # if debug status is False, turn off debug logging,
            # setting log level to default `logging.WARNING`
            for _, logger in six.iteritems(self.logger):
                logger.setLevel(logging.WARNING)
            # turn off httplib debug
            httplib.HTTPConnection.debuglevel = 0 
開發者ID:alohi,項目名稱:faxplus-python,代碼行數:22,代碼來源:configuration.py

示例2: debug

# 需要導入模塊: from six import moves [as 別名]
# 或者: from six.moves import http_client [as 別名]
def debug(self, value):
        """
        Sets the debug status.

        :param value: The debug status, True or False.
        :type: bool
        """
        self.__debug = value
        if self.__debug:
            # if debug status is True, turn on debug logging
            for _, logger in iteritems(self.logger):
                logger.setLevel(logging.DEBUG)
            # turn on httplib debug
            httplib.HTTPConnection.debuglevel = 1
        else:
            # if debug status is False, turn off debug logging,
            # setting log level to default `logging.WARNING`
            for _, logger in iteritems(self.logger):
                logger.setLevel(logging.WARNING)
            # turn off httplib debug
            httplib.HTTPConnection.debuglevel = 0 
開發者ID:docusign,項目名稱:docusign-python-client,代碼行數:23,代碼來源:configuration.py

示例3: mock_http_client_constructor

# 需要導入模塊: from six import moves [as 別名]
# 或者: from six.moves import http_client [as 別名]
def mock_http_client_constructor(self, mocker):
        mocker.patch.object(ssl, "SSLContext").return_value
        mocker.patch.object(HTTPTransport, "_create_ssl_context").return_value
        mock_client_constructor = mocker.patch.object(http_client, "HTTPSConnection", autospec=True)
        mock_client = mock_client_constructor.return_value
        response_value = mock_client.getresponse.return_value
        response_value.status = 1234
        response_value.reason = "__fake_reason__"
        response_value.read.return_value = "__fake_response_read_value__"
        return mock_client_constructor 
開發者ID:Azure,項目名稱:azure-iot-sdk-python,代碼行數:12,代碼來源:test_http_transport.py


注:本文中的six.moves.http_client方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。