tcms.rpc.api.testrun module

tcms.rpc.api.testrun.create(values)[source]
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

Return type:

dict

Raises:
  • PermissionDenied – if missing testruns.add_testrun permission
  • ValueError – if data validations fail

Example:

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

Update the selected TestRun

Parameters:
Returns:

Serialized tcms.testruns.models.TestRun object

Return type:

dict

Raises:
  • PermissionDenied – if missing testruns.change_testrun permission
  • ValueError – if data validations fail
tcms.rpc.api.testrun.filter(query=None)[source]
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.rpc.api.testrun.add_case(run_id, case_id)[source]
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.TestExecution object

Return type:

dict

Raises:
  • DoesNotExist – if objects specified by the PKs don’t exist
  • PermissionDenied – if missing testruns.add_testexecution permission
  • RuntimeError – if test case status is not CONFIRMED
tcms.rpc.api.testrun.get_cases(run_id)[source]
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 execution_id and status information.
Return type:list(dict)
tcms.rpc.api.testrun.remove_case(run_id, case_id)[source]
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
Raises:

PermissionDenied – if missing testruns.delete_testexecution permission

tcms.rpc.api.testrun.add_tag(run_id, tag_name, **kwargs)[source]
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
  • kwargs – Dict providing access to the current request, protocol entry point name and handler instance from the rpc method
Returns:

Serialized list of tcms.management.models.Tag objects

Return type:

dict

Raises:
  • PermissionDenied – if missing testruns.add_testruntag permission
  • TestRun.DoesNotExist – if object specified by PK doesn’t exist
  • Tag.DoesNotExist – if missing management.add_tag permission and tag_name doesn’t exist in the database!
tcms.rpc.api.testrun.remove_tag(run_id, tag_name)[source]
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

Return type:

dict

Raises:
  • PermissionDenied – if missing testruns.delete_testruntag permission
  • DoesNotExist – if objects specified don’t exist
tcms.rpc.api.testrun.add_cc(run_id, username)[source]
RPC TestRun.add_cc(run_id, username)

Add the chosen user to TestRun CC

Parameters:
  • run_id (int) – PK of TestRun to modify
  • username (string) – PK, email or username
Raises:
  • DoesNotExist – if test run specified by the PK doesn’t exist
  • PermissionDenied – if missing testruns.change_testrun permission
  • ValueError – if data validations fail
tcms.rpc.api.testrun.remove_cc(run_id, username)[source]
RPC TestRun.remove_cc(run_id, username)

Remove the chosen user from TestRun CC

Parameters:
  • run_id (int) – PK of TestRun to modify
  • username (string) – PK, email or username
Raises:
  • DoesNotExist – if test run specified by the PK doesn’t exist
  • PermissionDenied – if missing testruns.change_testrun permission
  • ValueError – if data validations fail