tcms.xmlrpc.api.testcase module

tcms.xmlrpc.api.testcase.create(values, **kwargs)[source]
XML-RPC TestCase.create(values)

Create a new TestCase object and store it in the database.

Parameters:values (dict) – Field values for tcms.testcases.models.TestCase
Returns:Serialized tcms.testcases.models.TestCase object
Return type:dict
Raises:PermissionDenied if missing testcases.add_testcase permission

Minimal test case parameters:

>>> values = {
    'category': 135,
    'product': 61,
'summary': 'Testing XML-RPC',
'priority': 1,
}
>>> TestCase.create(values)
tcms.xmlrpc.api.testcase.update(case_id, values, **kwargs)[source]
XML-RPC TestCase.update(case_id, values)

Update the fields of the selected test case.

Parameters:
Returns:

Serialized tcms.testcases.models.TestCase object

Return type:

dict

Raises:

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

Raises:

PermissionDenied if missing testcases.change_testcase permission

tcms.xmlrpc.api.testcase.filter(query)[source]
XML-RPC TestCase.filter(query)

Perform a search and return the resulting list of test cases augmented with their latest text.

Parameters:query (dict) – Field lookups for tcms.testcases.models.TestCase
Returns:Serialized list of tcms.testcases.models.TestCase objects. The key text holds a the latest version of a serialized tcms.testcases.models.TestCaseText object!
Return type:list(dict)
tcms.xmlrpc.api.testcase.add_component(case_id, component_id)[source]
XML-RPC TestCase.add_component(case_id, component_id)

Add component to the selected test case.

Parameters:
  • case_id (int) – PK of TestCase to modify
  • component_id (int) – PK of Component to add
Returns:

None

Raises:

PermissionDenied if missing the testcases.add_testcasecomponent permission

Raises:

DoesNotExist if missing test case or component that match the specified PKs

tcms.xmlrpc.api.testcase.get_components(case_id)[source]
XML-RPC TestCase.get_components(case_id)

Get the list of components attached to this case.

Parameters:case_id (int) – PK if TestCase
Returns:Serialized list of tcms.management.models.Component objects
Return type:list(dict)
Raises:TestCase.DoesNotExist if missing test case matching PK
tcms.xmlrpc.api.testcase.remove_component(case_id, component_id)[source]
XML-RPC TestCase.remove_component(case_id, component_id)

Remove selected component from the selected test case.

Parameters:
  • case_id (int) – PK of TestCase to modify
  • component_id (int) – PK of Component to remove
Returns:

None

Raises:

PermissionDenied if missing the testcases.delete_testcasecomponent permission

Raises:

DoesNotExist if missing test case or component that match the specified PKs

tcms.xmlrpc.api.testcase.add_notification_cc(case_id, cc_list)[source]
XML-RPC TestCase.add_notification_cc(case_id, cc_list)

Add email addresses to the notification list of specified TestCase

Parameters:
  • case_id – PK of TestCase to be modified
  • case_id – int
  • cc_list (list(str)) – List of email addresses
Returns:

None

Raises:

TypeError or ValidationError if email validation fails

Raises:

PermissionDenied if missing testcases.change_testcase permission

Raises:

TestCase.DoesNotExist if object with case_id doesn’t exist

tcms.xmlrpc.api.testcase.get_notification_cc(case_id)[source]
XML-RPC TestCase.get_notification_cc(case_id)

Return notification list for specified TestCase

Parameters:case_id (int) – PK of TestCase
Returns:List of email addresses
Return type:list(str)
Raises:TestCase.DoesNotExist if object with case_id doesn’t exist
tcms.xmlrpc.api.testcase.remove_notification_cc(case_id, cc_list)[source]
XML-RPC TestCase.remove_notification_cc(case_id, cc_list)

Remove email addresses from the notification list of specified TestCase

Parameters:
  • case_id (int) – PK of TestCase to modify
  • cc_list (list(str)) – List of email addresses
Returns:

None

Raises:

TypeError or ValidationError if email validation fails

Raises:

PermissionDenied if missing testcases.change_testcase permission

Raises:

TestCase.DoesNotExist if object with case_id doesn’t exist

tcms.xmlrpc.api.testcase.add_tag(case_id, tag, **kwargs)[source]
XML-RPC TestCase.add_tag(case_id, tag)

Add one tag to the specified test case.

Parameters:
  • case_id (int) – PK of TestCase to modify
  • tag (str) – Tag name to add
Returns:

None

Raises:

PermissionDenied if missing testcases.add_testcasetag permission

Raises:

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

Raises:

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

tcms.xmlrpc.api.testcase.remove_tag(case_id, tag)[source]
XML-RPC TestCase.remove_tag(case_id, tag)

Remove tag from a test case.

Parameters:
  • case_id (int) – PK of TestCase to modify
  • tag (str) – Tag name to remove
Returns:

None

Raises:

PermissionDenied if missing testcases.delete_testcasetag permission

Raises:

DoesNotExist if objects specified don’t exist