polarion_rest_api_client package

Subpackages

Submodules

polarion_rest_api_client.client module

The overall Polarion Client which handles the HTTP session, auth etc.

class polarion_rest_api_client.client.DefaultFields

Bases: object

A class to define default values for the fields parameter.

property all_types: dict[str, str]

Return all fields dicts merged together.

property documents: dict[str, str]

Return the fields dict for document.

property linkedworkitems: dict[str, str]

Return the fields dict for linkedworkitems.

property testrecords: dict[str, str]

Return the fields dict for document.

property testruns: dict[str, str]

Return the fields dict for document.

property teststeps: dict[str, str]

Return the fields dict for document.

property workitem_attachments: dict[str, str]

Return the fields dict for workitem_attachments.

property workitems: dict[str, str]

Return the fields dict for workitems.

class polarion_rest_api_client.client.PolarionClient(polarion_api_endpoint: str, polarion_access_token: str, httpx_args: dict[str, Any] | None = None, batch_size: int = 100, page_size: int = 100, max_content_size: int = 2097152)

Bases: object

The overall, project independent Polarion client.

generate_project_client(project_id: str, delete_status: str | None = None) ProjectClient

Return a client for a specific project.

polarion_rest_api_client.data_models module

Data model classes returned by the client.

class polarion_rest_api_client.data_models.Document(id: str | None = None, module_folder: str | None = None, module_name: str | None = None, type: str | None = None, status: str | None = None, home_page_content: TextContent | None = None, title: str | None = None, rendering_layouts: list[RenderingLayout] | None = None, outline_numbering: bool | None = None, outline_numbering_prefix: str | None = None)

Bases: StatusItem

A data class containing all relevant data of a Polarion Document.

home_page_content: TextContent | None = None
module_folder: str | None = None
module_name: str | None = None
outline_numbering: bool | None = None
outline_numbering_prefix: str | None = None
title: str | None = None
class polarion_rest_api_client.data_models.DocumentReference(module_folder: str, module_name: str)

Bases: object

A reference to a document to be used in relations.

module_folder: str
module_name: str
class polarion_rest_api_client.data_models.HtmlContent(value: str)

Bases: TextContent

A specialized class for HTML based TextContent.

class polarion_rest_api_client.data_models.Layouter(*values)

Bases: Enum

Layout selection for work items in documents.

DEFAULT = 'default'
PARAGRAPH = 'paragraph'
SECTION = 'section'
TITLE = 'title'
TITLE_DESC_TEST_STEPS = 'titleDescTestSteps'
TITLE_TEST_STEPS = 'titleTestSteps'
class polarion_rest_api_client.data_models.RenderingLayout(label: str | None = None, layouter: Layouter | str | None = None, properties: list[dict[str, Any]] | RenderingProperties | None = None, type: str | None = None)

Bases: object

A class to describe how a work item should be rendered in a document.

label: str | None = None
layouter: Layouter | None = None
properties: RenderingProperties | None = None
type: str | None = None
class polarion_rest_api_client.data_models.RenderingProperties(fields_at_start: list[str] | None = None, fields_at_end: list[str] | None = None, sidebar_work_item_fields: list[str] | None = None, fields_at_end_as_table: bool = False, hidden: bool = False)

Bases: object

Properties for custom field rendering of workitems in documents.

fields_at_end: list[str] | None = None
fields_at_end_as_table: bool = False
fields_at_start: list[str] | None = None
hidden: bool = False
serialize() list[dict[str, Any]]

Serialize an instance of this class to be sent via the API.

sidebar_work_item_fields: list[str] | None = None
class polarion_rest_api_client.data_models.SelectTestCasesBy(*values)

Bases: str, Enum

Test case selection mode enum.

AUTOMATEDPROCESS = 'automatedProcess'
DYNAMICLIVEDOC = 'dynamicLiveDoc'
DYNAMICQUERYRESULT = 'dynamicQueryResult'
MANUALSELECTION = 'manualSelection'
STATICLIVEDOC = 'staticLiveDoc'
STATICQUERYRESULT = 'staticQueryResult'
class polarion_rest_api_client.data_models.StatusItem(id: str | None = None, type: str | None = None, status: str | None = None)

Bases: object

A parent data class for WorkItem and Document.

id: str | None = None
status: str | None = None
to_dict() dict[str, Any]

Return the content of the StatusItem as dictionary.

type: str | None = None
class polarion_rest_api_client.data_models.TestRecord(test_run_id: str, work_item_project_id: str, work_item_id: str, work_item_revision: str | None = None, iteration: int = -1, duration: float = -1, result: str | None = None, comment: ~polarion_rest_api_client.data_models.TextContent | None = None, executed: ~datetime.datetime | None = None, additional_attributes: dict[str, ~typing.Any] = <factory>)

Bases: object

A data class for test record data.

additional_attributes: dict[str, Any]
comment: TextContent | None = None
duration: float = -1
executed: datetime | None = None
iteration: int = -1
result: str | None = None
test_run_id: str
work_item_id: str
work_item_project_id: str
work_item_revision: str | None = None
class polarion_rest_api_client.data_models.TestRun(id: str | None = None, type: str | None = None, status: str | None = None, title: str | None = None, home_page_content: ~polarion_rest_api_client.data_models.TextContent | None = None, finished_on: ~datetime.datetime | None = None, group_id: str | None = None, id_prefix: str | None = None, is_template: bool | None = None, keep_in_history: bool | None = None, query: str | None = None, use_report_from_template: bool | None = None, select_test_cases_by: ~polarion_rest_api_client.data_models.SelectTestCasesBy | None = None, additional_attributes: dict[str, ~typing.Any] = <factory>)

Bases: StatusItem

A data class for all data of a test run.

additional_attributes: dict[str, Any]
finished_on: datetime | None = None
group_id: str | None = None
home_page_content: TextContent | None = None
id_prefix: str | None = None
is_template: bool | None = None
keep_in_history: bool | None = None
query: str | None = None
select_test_cases_by: SelectTestCasesBy | None = None
title: str | None = None
use_report_from_template: bool | None = None
class polarion_rest_api_client.data_models.TestStep(work_item_id: str, step_index: int | None = None, revision: str | None = None, step_columns: dict[str, ~polarion_rest_api_client.data_models.TextContent] = <factory>)

Bases: object

Representation of TestSteps of a test case WorkItem in Polarion.

revision: str | None = None
step_columns: dict[str, TextContent]
step_index: int | None = None
work_item_id: str
class polarion_rest_api_client.data_models.TextContent(type: str | None, value: str | None)

Bases: dict

A data class for text content in Polarion.

property type

Return type of the TextContent.

property value

Return value of the TextContent.

class polarion_rest_api_client.data_models.WorkItem(id: str | None = None, *, title: str | None = None, description_type: str | None = None, description: TextContent | str | None = None, type: str | None = None, status: str | None = None, additional_attributes: dict[str, Any] | None = None, linked_work_items: list[WorkItemLink] | None = None, attachments: list[WorkItemAttachment] | None = None, linked_work_items_truncated: bool = False, attachments_truncated: bool = False, home_document: DocumentReference | None = None, **kwargs)

Bases: StatusItem

A data class containing all relevant data of a Polarion WorkItem.

additional_attributes: dict[str, Any] = {}
attachments: list[WorkItemAttachment] = []
attachments_truncated: bool = False
description: TextContent | None = None
home_document: DocumentReference | None = None
linked_work_items: list[WorkItemLink] = []
linked_work_items_truncated: bool = False
title: str | None = None
to_dict() dict[str, Any]

Return the content of the WorkItem as dictionary.

class polarion_rest_api_client.data_models.WorkItemAttachment(work_item_id: str, id: str, title: str | None = None, content_bytes: bytes | None = None, mime_type: str | None = None, file_name: str | None = None)

Bases: object

An Attachment of a WorkItem.

content_bytes: bytes | None = None
file_name: str | None = None
id: str
mime_type: str | None = None
title: str | None = None
work_item_id: str

Bases: object

A link between multiple Polarion WorkItems.

The primary_work_item_id is the ID of the owner of the link, the secondary_work_item_id represents the linked workitem.

primary_work_item_id: str
role: str
secondary_work_item_id: str
secondary_work_item_project: str | None = None
suspect: bool | None = None

polarion_rest_api_client.errors module

Polarion API related errors.

exception polarion_rest_api_client.errors.PolarionApiBaseException

Bases: Exception

Base exception, which is raised, if an API error occurs.

exception polarion_rest_api_client.errors.PolarionApiException

Bases: PolarionApiBaseException

Exception, which is raised, if an error is raised by the API.

exception polarion_rest_api_client.errors.PolarionApiInternalException

Bases: Exception

Exception being raised, if an error occurs in the client itself.

exception polarion_rest_api_client.errors.PolarionApiUnexpectedException

Bases: PolarionApiBaseException

Exception, which is raised, if an unexpected error is raised.

exception polarion_rest_api_client.errors.PolarionWorkItemException(message: str, work_item: WorkItem)

Bases: PolarionApiInternalException

Exception being raised, if a WorkItem related error occurs.

Module contents

Polarion API module serving all data classes, clients and errors.