tcms.rpc.api.testrun module

tcms.rpc.api.testrun.add_attachment(run_id, filename, b64content, **kwargs)[source]
RPC TestRun.add_attachment(run_id, filename, b64content)

Add attachment to the given TestRun.

Parameters:
  • run_id (int) – PK of TestRun

  • filename (str) – File name of attachment, e.g. ‘logs.txt’

  • b64content (str) – Base64 encoded content

  • **kwargs – Dict providing access to the current request, protocol, entry point name and handler instance from the rpc method

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:

A list of serialized tcms.testruns.models.TestExecution objects

Return type:

list(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.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.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.annotate_executions_with_properties(executions_iterable)[source]
tcms.rpc.api.testrun.create(values, **kwargs)[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

  • **kwargs – Dict providing access to the current request, protocol, entry point name and handler instance from the rpc method

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.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.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.properties(query=None)[source]
TestRun.properties(query)

Return all properties for the specified test run(s).

Parameters:

query (dict) – Field lookups for tcms.testruns.models.Property

Returns:

Serialized list of tcms.testruns.models.Property objects.

Return type:

list(dict)

Raises:

PermissionDenied – if missing testruns.view_property permission

tcms.rpc.api.testrun.remove_case(run_id, case_id)[source]
RPC TestRun.remove_case(run_id, case_id)

WARNING: this method is deprecated in favor of TestExecution.remove()! Nothing in Kiwi TCMS uses it directly and it will be removed in the future!

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

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.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