tcms.rpc.api.testplan module

tcms.rpc.api.testplan.create(values, **kwargs)[source]
XML-RPC TestPlan.create(values)

Create new Test Plan object and store it in the database.

Parameters:
  • values (dict) – Field values for tcms.testplans.models.TestPlan
  • kwargs – Dict providing access to the current request, protocol entry point name and handler instance from the rpc method
Returns:

Serialized tcms.testplans.models.TestPlan object

Return type:

dict

Raises:
  • PermissionDenied – if missing testplans.add_testplan permission
  • ValueError – if data validation fails

Minimal parameters:

>>> values = {
    'product': 61,
    'product_version': 93,
    'name': 'Testplan foobar',
    'type': 1,
    'parent': 150,
    'text':'Testing TCMS',
}
>>> TestPlan.create(values)
tcms.rpc.api.testplan.update(plan_id, values)[source]
XML-RPC TestPlan.update(plan_id, values)

Update the fields of the selected test plan.

Parameters:
Returns:

Serialized tcms.testplans.models.TestPlan object

Return type:

dict

Raises:
  • TestPlan.DoesNotExist – if object specified by PK doesn’t exist
  • PermissionDenied – if missing testplans.change_testplan permission
  • ValueError – if validations fail
tcms.rpc.api.testplan.filter(query=None)[source]
XML-RPC TestPlan.filter(query)

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

Parameters:query (dict) – Field lookups for tcms.testplans.models.TestPlan
Returns:List of serialized tcms.testplans.models.TestPlan objects
Return type:list(dict)
tcms.rpc.api.testplan.add_case(plan_id, case_id)[source]
XML-RPC TestPlan.add_case(plan_id, case_id)

Link test case to the given plan.

Parameters:
  • plan_id (int) – PK of TestPlan to modify
  • case_id (int) – PK of TestCase to be added to plan
Raises:
  • TestPlan.DoesNotExit or TestCase.DoesNotExist – if objects specified by PKs are missing
  • PermissionDenied – if missing testcases.add_testcaseplan permission
tcms.rpc.api.testplan.remove_case(plan_id, case_id)[source]
XML-RPC TestPlan.remove_case(plan_id, case_id)

Unlink a test case from the given plan.

Parameters:
  • plan_id (int) – PK of TestPlan to modify
  • case_id (int) – PK of TestCase to be removed from plan
Raises:

PermissionDenied – if missing testcases.delete_testcaseplan permission

tcms.rpc.api.testplan.add_tag(plan_id, tag_name, **kwargs)[source]
XML-RPC TestPlan.add_tag(plan_id, tag_name)

Add a tag to the specified test plan.

Parameters:
  • plan_id (int) – PK of TestPlan 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
Raises:
  • PermissionDenied – if missing testplans.add_testplantag permission
  • TestPlan.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.testplan.remove_tag(plan_id, tag_name)[source]
XML-RPC TestPlan.remove_tag(plan_id, tag_name)

Remove tag from the specified test plan.

Parameters:
  • plan_id (int) – PK of TestPlan to modify
  • tag_name (str) – Tag name to remove
Raises:
  • PermissionDenied – if missing testplans.delete_testplantag permission
  • DoesNotExist – if objects specified don’t exist
tcms.rpc.api.testplan.add_attachment(plan_id, filename, b64content, **kwargs)[source]
XML-RPC TestPlan.add_attachment(plan_id, filename, b64content)

Add attachment to the given TestPlan.

Parameters:
  • plan_id (int) – PK of TestPlan
  • 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.testplan.list_attachments(plan_id, **kwargs)[source]
XML-RPC TestPlan.list_attachments(plan_id)

List attachments for the given TestPlan.

Parameters:
  • plan_id (int) – PK of TestPlan to inspect
  • kwargs – Dict providing access to the current request, protocol entry point name and handler instance from the rpc method
Returns:

A list containing information and download URLs for attachements

Return type:

list

Raises:

TestPlan.DoesNotExit – if object specified by PK is missing