tcms.xmlrpc.api.testrun module

tcms.xmlrpc.api.testrun.create(values)[source]
XML-RPC TestRun.create(values)

Create new TestRun object and store it in the database.

Parameters:values (dict) – Field values for tcms.testruns.models.TestRun
Returns:Serialized tcms.testruns.models.TestRun object
Raises:PermissionDenied if missing testruns.add_testrun permission
Raises:ValueError if data validations fail

Example:

>>> values = {'build': 384,
    'manager': 137,
    'plan': 137,
    'summary': 'Testing XML-RPC for TCMS',
}
>>> TestRun.create(values)
tcms.xmlrpc.api.testrun.update(run_id, values)[source]
XML-RPC TestRun.update(run_id, values)

Update the selected TestRun

Parameters:
Returns:

Serialized tcms.testruns.models.TestRun object

Raises:

PermissionDenied if missing testruns.change_testrun permission

Raises:

ValueError if data validations fail

tcms.xmlrpc.api.testrun.filter(query=None)[source]
XML-RPC TestRun.filter(query)

Perform a search and return the resulting list of test runs.

Parameters:query (dict) – Field lookups for tcms.testruns.models.TestRun
Returns:List of serialized tcms.testruns.models.TestRun objects
Return type:list(dict)
tcms.xmlrpc.api.testrun.add_case(run_id, case_id)[source]
XML-RPC TestRun.add_case(run_id, case_id)

Add a TestCase to the selected test run.

Parameters:
  • run_id (int) – PK of TestRun to modify
  • case_id (int) – PK of TestCase to be added
Returns:

Serialized tcms.testruns.models.TestCaseRun object

Raises:

DoesNotExist if objects specified by the PKs don’t exist

Raises:

PermissionDenied if missing testruns.add_testcaserun permission

tcms.xmlrpc.api.testrun.get_cases(run_id)[source]
XML-RPC TestRun.get_cases(run_id)

Get the list of test cases that are attached to a test run.

Parameters:run_id (int) – PK of TestRun to inspect
Returns:Serialized list of tcms.testcases.models.TestCase objects augmented with case_run_id and case_run_status information.
Return type:list(dict)
tcms.xmlrpc.api.testrun.remove_case(run_id, case_id)[source]
XML-RPC TestRun.remove_case(run_id, case_id)

Remove a TestCase from the selected test run.

Parameters:
  • run_id (int) – PK of TestRun to modify
  • case_id (int) – PK of TestCase to be removed
Returns:

None

Raises:

PermissionDenied if missing testruns.delete_testcaserun permission

tcms.xmlrpc.api.testrun.add_tag(run_id, tag_name, **kwargs)[source]
XML-RPC TestRun.add_tag(run_id, tag)

Add one tag to the specified test run.

Parameters:
  • run_id (int) – PK of TestRun to modify
  • tag_name (str) – Tag name to add
Returns:

Serialized list of tcms.management.models.Tag objects

Raises:

PermissionDenied if missing testruns.add_testruntag permission

Raises:

TestRun.DoesNotExist if object specified by PK doesn’t exist

Raises:

Tag.DoesNotExist if missing management.add_tag permission and tag_name doesn’t exist in the database!

tcms.xmlrpc.api.testrun.remove_tag(run_id, tag_name)[source]
XML-RPC TestRun.remove_tag(run_id, tag)

Remove a tag from the specified test run.

Parameters:
  • run_id (int) – PK of TestRun to modify
  • tag_name (str) – Tag name to add
Returns:

Serialized list of tcms.management.models.Tag objects

Raises:

PermissionDenied if missing testruns.delete_testruntag permission

Raises:

DoesNotExist if objects specified don’t exist