client.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pact-broker-client 作者: Babylonpartners 项目源码 文件源码
def __init__(
        self,
        *,
        broker_url,
        pact_dir='.',
        user=None,
        password=None,
        authentication=False
    ):
        self.broker_url = broker_url.rstrip('/')
        self.username = user
        self.password = password
        self.pact_dir = pact_dir
        self.authentication = authentication
        self._auth = None

        if self.authentication:
            if not (self.username and self.password):
                raise ValueError(
                    'When authentication is True, username and password '
                    'must be provided.'
                )
            else:
                self._auth = HTTPBasicAuth(self.username, self.password)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号