lczub / TestLink-API-Python-client

A Python client to use the TestLink API
104 stars 63 forks source link

WIP: allow for user defined context #89

Closed AdamRivelli closed 7 years ago

AdamRivelli commented 7 years ago

This merge will allow for a user defined context in the call to xmlrpclib.Server().

A use of this could look like:

import ssl
from testlink import TestlinkAPIGeneric, TestLinkHelper
my_test_link = TestLinkHelper(TESTLINK_API_PYTHON_SERVER_URL, TESTLINK_API_PYTHON_DEVKEY)\
    .connect(TestlinkAPIGeneric, context = ssl._create_unverified_context())
lczub commented 7 years ago

Hello Adam,

do you still need a solution for your context problem or have you found another solution? Is there a requirement , the api should solve?

Regards Luiko

AdamRivelli commented 7 years ago

Luiko,

I have found another solution to my problem. I used monkey patching to get around the issue, with the following line in my own program: ssl._create_default_https_context = ssl._create_unverified_https_context

Although I would prefer a nicer solution to my problem, I'm not sure that it should be a part of the API. You support python 3.4, but the context argument to xmlrpc.client.ServerProxy() was added in python 3.5. I think this would force there to be some difference in the API's functionality when used by python 3.4 and later versions.

lczub commented 7 years ago

Hello Adam,

fyi, the latest release v0.6.4 is also tested against 3.5.3 and 3.6.1