from XMLRPC.TestLinkAPI.src import testlink
class ConnectToTestLink:
TESTLINK_API_PYTHON_SERVER_URL = "abc.com";
TESTLINK_API_PYTHON_DEVKEY = "e9e245fdhsgfdsghfd18e9"
tls = testlink.TestLinkHelper.connect(testlink.TestlinkAPIClient)
#tls.countProjects();
我收到以下错误:
unbound method connect() must be called with TestLinkHelper instance as first argument (got type instance instead)
(作为参考,我关注此网址: https://pypi.python.org/pypi/TestLink-API-Python-client)
答案 0 :(得分:0)
tls = testlink.TestLinkHelper(ConnectToTestLink.TESTLINK_API_PYTHON_SERVER_URL,
ConnectToTestLink.TESTLINK_API_PYTHON_DEVKEY).connect(testlink.TestlinkAPIClient)
答案 1 :(得分:0)
您可以添加
from testlink import TestlinkAPIGeneric, TestLinkHelper
然后
TESTLINK_API_PYTHON_SERVER_URL = "abc.com";
TESTLINK_API_PYTHON_DEVKEY = "e9e245fdhsgfdsghfd18e9"
my_test_link = TestLinkHelper(TESTLINK_API_PYTHON_SERVER_URL, TESTLINK_API_PYTHON_DEVKEY).connect(TestlinkAPIGeneric)