Closed nitrocode closed 9 years ago
Nevermind. Somehow when I ran the example script it created a .pyc file in my homefolder and kept trying to run that. I removed the .pyc file and I was able to import testlink correctly. Also do not try to import a module from the directory of the package. You will get the "Attempted relative import in non-package" error.
Also realized that the set commands did not work. What did work was the following:
import testlink
TESTLINK_API_PYTHON_SERVER_URL="https://testlink/etc/etc/etc"
TESTLINK_API_PYTHON_DEVKEY="someapikey"
tls = testlink.TestLinkHelper( TESTLINK_API_PYTHON_SERVER_URL, TESTLINK_API_PYTHON_DEVKEY ).connect(testlink.TestlinkAPIClient)
print tls.countProjects()
tc_info = tls.getTestCase(None, testcaseexternalid='S-10000')
print tc_info
print tls.whatArgs('createTestPlan')
Thank you for the API
Hello nitrocode,
I'm sorry, I could not reproduce your failure situation with my debian installation.
It looks like a general problem with your python environment. Have you tried to install other packages from https://pypi.python.org/pypi ?
Tipp: It's always a good idea, not to install such additional packages directly into your main python installation. Better approach is to setup a "virtual python" installations via virtualenv. More infos see https://virtualenv.pypa.io/en/latest/virtualenv.html
Hope this helps a little bit. Luiko
I downloaded the latest version of pip for Python 2.7 Installed using the pip command successfully I set the TESTLINK environment variables
Opened Python and ran
and I received an import error
I also tried running some of the example scripts but also received errors.
I navigated to
/usr/local/lib/python2.7/dist-packages/testlink
where the module was installed and attempted to run some of the code within the scripts:Not sure what I'm doing wrong...