def testGettingUserPassword(self): urls = (('http://irgendwas.com', None, None), ('http://*****:*****@irgendwas.com', 'heinz', 'secret')) for test_url, exp_user, exp_passwd in urls: print('testing url ' + test_url) url, user, passwd = Retrieve.get_user_password(test_url) assert user == exp_user assert passwd == exp_passwd if user: assert url != test_url
def _connect_clients(cls, service_urls, user=None, password=None, default_timeout=WS_DEFAULT_TIMEOUT): clients = [] if isinstance(service_urls, str): service_urls = [service_urls] for url in service_urls: service_url, user, password = Retrieve.get_user_password(url) clients.append(RESTClient(service_url=service_url, user=user, password=password, default_timeout=default_timeout)) return clients
def _connect_clients(cls, service_urls, user=None, password=None, default_timeout=WS_DEFAULT_TIMEOUT): clients = [] if isinstance(service_urls, str): service_urls = [service_urls] for url in service_urls: service_url, new_user, new_password = Retrieve.get_user_password(url) clients.append(RESTClient(service_url=service_url, user=user or new_user, password=password or new_password, default_timeout=default_timeout)) return clients