当前位置: 首页>>代码示例>>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;未经允许,请勿转载。