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)
评论列表
文章目录