Polarion client =============== The polarion connects to the WSDL services of the Polarion service. These are listed at /ws/services. It is important that the url it the url where you normally login. So it should include /polarion in most cases. Initialization -------------- The class can be instantiated like this: .. code:: python pol = polarion.Polarion('http://example.com/polarion', 'user', 'password') print(pol) # Polarion client for http://example.com/polarion/ws/services with user Token ----- If you are using a token to autenticates: .. code:: python pol = polarion.Polarion('http://example.com/polarion', 'user', password=None, token='token') print(pol) # Polarion client for http://example.com/polarion/ws/services with user Proxy ----- You can specify a proxy by providing an domain or ip with a port number. .. code:: python pol = polarion.Polarion('http://example.com/polarion', 'user', 'password', proxy='ip:port') Self signed certificates ------------------------ If your polarion instance has a self signed certificate or an expired certificate, a https connections will be rejected. You can skip certificate verification by passed an additional argument. .. code:: python pol = polarion.Polarion('http://example.com/polarion', 'user', 'password', verify_certificate=False) SVN repository location ----------------------- The SVN repository access can be different from the standard (http://example.com/repo). If this is the case, pass the new location using svn_repo_url. This is used while download attachment form test runs or test records. .. code:: python pol = polarion.Polarion('http://example.com/polarion', 'user', 'password', svn_repo_url='http://example.com/repo_location') Retry Mechanism --------------- A custom retry strategy can be set by using the request_session parameter of the polarion constructor. See example below. .. code:: python import requests from requests.adapters import HTTPAdapter, Retry from polarion import polarion # example of a retry strategy my_sess = requests.Session() retries = Retry(total=5, backoff_factor=0.1, status_forcelist=[ 500, 502, 503, 504 ]) # only retry those status codes my_sess.mount('http://', HTTPAdapter(max_retries=retries)) # for all http connections pol = polarion.Polarion('http://example.com/polarion', 'user', 'password', request_session=my_sess) Slow performance ---------------- Sometimes a bug in the soap client can cause poor performance. Disabling session validation can help in this case. .. code:: python from requests import Session from polarion import polarion from requests.auth import HTTPBasicAuth def login(user:str, pw:str) ->polarion.Polarion: session = Session() session.auth = HTTPBasicAuth(user, pw) session.verify = False client = polarion.Polarion('url', user, pw, proxy='url', request_session=session, verify_certificate=True) return client Services -------- Typically you would not use any service directly, but it is an option. Using it this way would ensure the session is still valid. .. warning:: The refreshing of the session is still an open issue and not yet implemented. Using this module for prolonged time will likely lead to an ended session. .. code:: python pol = polarion.Polarion('http://example.com/polarion', 'user', 'password') s = pol.getService('Tracker') print(s) # Polarion class -------------- .. autoclass:: polarion.polarion.Polarion :members: