예제 #1
0
    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
예제 #2
0
파일: __init__.py 프로젝트: weblyzard/ewrt
    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
예제 #3
0
파일: __init__.py 프로젝트: weblyzard/ewrt
    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