Skip to content

weichen2046/python-libwebcq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-libwebcq

A wrapper library for accessing web ClearQuest(CQ).

Setup environment

virtualenv

cd /project/root/dir
virtualenv -p python3.6 .pyenv

Install dependency python packages

requests

pip install requests

nose

pip install nose

demjson

pip install demjson

How to use

cq = CQ('your://webcq/host')
# Open a session befoer any network query.
cq.open_session()
try:
    # Need login before query protected resources.
    res = cq.login('username', 'password', 'repository')
    res_id1 = cq.find_record('record_id_1')
    record1 = cq.get_cq_record_details(res_id1, RecordType.CRP)
    res_id2 = cq.find_record('record_id_2')
    record2 = cq.get_cq_record_details(res_id2, RecordType.CRP)
    # Don't forget logout.
    cq.logout()
finally:
    # Close session when all work done.
    cq.close_session()

How to run unit test

You need setup test configurations before you can run any tests. Just rename test/unit/test_config_example.py to test/unit/test_config.py and replace all values for each key in mockdata dictionary according to your real CQ server.

Run all tests:

nosetests test -v

Run single test just like the following:

nosetests test.unit.test_CQ:CQTestCase.test_get_db_sets -v

About

A wrapper library for accessing web ClearQuest(CQ).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages