pylero package

Subpackages

Submodules

pylero.activity module

class pylero.activity.Activity(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:Activity class

activity_custom_values
Type:

list of ActivityCustomValueEntry

comments
Type:

list of ActivityComment

context_id
Type:

ContextId

global_id
Type:

string

activity_id
Type:

string

info
Type:

Text

prefix
Type:

string

resource_locations
Type:

list

source_id
Type:

string

timestamp
Type:

dateTime

type
Type:

string

user_id
Type:

string

pylero.activity_comment module

class pylero.activity_comment.ActivityComment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:ActivityComment class

text
Type:

Text

time_stamp
Type:

dateאime

user_id
Type:

string

pylero.activity_custom_value module

class pylero.activity_custom_value.ActivityCustomValue(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:ActivityCustomValue class

values
Type:

ArrayOf_xsd_string

pylero.activity_custom_value_entry module

class pylero.activity_custom_value_entry.ActivityCustomValueEntry(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:ActivityCustomValueEntry class

custom_values
Type:

ActivityCustomValue

key
Type:

string

pylero.activity_source module

class pylero.activity_source.ActivitySource(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:ActivitySource class

activity_source_id
Type:

string

prefix
Type:

string

types
Type:

ArrayOf_xsd_string

pylero.approval module

class pylero.approval.Approval(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:Approval class

status
Type:

EnumOptionId

user
Type:

User

class pylero.approval.ArrayOfApproval(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

pylero.attachment module

class pylero.attachment.ArrayOfAttachment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.attachment.Attachment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:Attachment class

author
Type:

User

file_name
Type:

string

attachment_id
Type:

string

length
Type:

long

title
Type:

string

updated
Type:

dateTime

url
Type:

string

pylero.base_polarion module

class pylero.base_polarion.BasePolarion(obj_id=None, suds_object=None)[source]

Bases: object

BasePolarion is the parent class for all the WSDL Polarion objects that are published. Using the _cls_suds_map, the class creates a property for each attribute so that any access of the object attribute, will access the WSDL object that is contained by it.

_cls_suds_map

maps the Polarion attribute names to the Pylero attribute names. Attributes that reference either objects or an array of objects have the properties relate to the relationship meaning that accessing the property will give access to the object or list of objects.

Type:

dict

_id_field

the field that represents an id field, used in the child class’s constructor. when a child’s class defines the field it allows this constructor to accept an obj_id as a parameter

Type:

str

_obj_client

The Polarion client child’s WSDL object is defined by

Type:

str

_obj_struct

The data type defined by the WSDL library. The structure of the datatype is tnsX:ObjectName, the X is per datatype and has no default.

Type:

str

session

The Polarion Session object, initialized by the Connection class. This attribute connects to the server one time per session, no matter how many objects are instantiated.

Type:

Session

default_project

The user’s default project, to be used when project_id is needed and there is none given

Type:

str

REGEX_ID = '.+}(.*)$'
REGEX_PROJ = '/default/(.*)\\$'
classmethod URI_ID_GET_REPLACE(x)
classmethod URI_ID_SET_REPLACE(x)
URI_STRUCT = 'subterra:data-service:objects:/default/%(project)s${%(obj)s}%(id)s'
__init__(obj_id=None, suds_object=None)[source]
can_add_element_to_key(key)[source]

Checks if the current user can add elements to the collection at given key of the current object.

Parameters:

key – the key of the field that contains the collection.

Returns:

bool

References

Security.canAddElementToKey

can_delete_instance()[source]

Checks if the current user can delete the current object

Parameters:

None

Returns:

bool

References

Security.canDeleteInstance

can_modify_instance()[source]

Checks if the current user can modify the current object

Parameters:

None

Returns:

bool

References

Security.canModifyInstance

can_modify_key(key)[source]

Checks if the current user can modify the field with given key of the current object.

Parameters:

key – the key of the field that contains the collection.

Returns:

bool

References

Security.canModifyKey

can_read_instance()[source]

Checks if the current user can read the current object

Parameters:

None

Returns:

bool

References

Security.canReadInstance

can_read_key(key)[source]

Checks if the current user can read the field with given key of the current object.

Parameters:

key – the key of the field that contains the collection.

Returns:

bool

References

Security.canReadKey

can_remove_element_from_key(key)[source]

Checks if the current user can remove elements from the collection at given key of the current object.

Parameters:

key – the key of the field that contains the collection.

Returns:

bool

References

Security.canRemoveElementFromKey

check_valid_field_values(val, enum_id, additional_parms, control=None)[source]

verifies id the value passed in is valid for the enum or object passed in. for example, if we want to see if a valid user is given, this will try to instantiate the User class with the given parameter and additional parms. If it fails, it is not a valid value.

Parameters:
  • val – the value you want to set it to.

  • enum_id – the enumeration or object to validate against

  • additional_parms (dict) – parms needed to instantiate class passed in as enum_id

  • control – the control key for the enumeration. default:None

custom_array_obj()[source]
custom_obj()[source]
default_project = 'POLARION_PROJECT'
classmethod get_global_roles()[source]

Returns all global roles.

Parameters:

None

Returns:

list of global roles

References

Security.getGlobalRoles()

get_location()[source]

Returns the location of the current object. In the context of this service the method should be used to get the location of a project(-group).

Parameters:

None

Returns:

location (string)

References

Security.getLocationForURI

get_revision(repository_name, revision_id)[source]

Gets a revision :param repository_name - The repository name.: :type repository_name - The repository name.: Put “default” for the default repository. :param revision_id - The revision name.:

Returns:

a Revision object

get_revision_by_uri(revision_uri)[source]

Gets a revision by its URI :param revision_uri - The URI of the revision.:

Returns:

a Revision object

get_revisions(uri)[source]

Returns all revisions for a specific URI. :param uri - URI of the persistence object: :type uri - URI of the persistence object: Work Item, Module/Document, User, etc

Returns:

All revisions for a specific URI.

get_valid_field_values(enum_id, control=None)[source]

Gets the available enumeration options. Uses a cache dict because the time to get valid fields from server is time prohibitive.

Parameters:
  • enum_id – The enum code to get values for

  • control – the control key for the enumeration. default:None

Returns:

Array of EnumOptions

References

Tracker.getEnumOptionsForId

classmethod has_current_user_permission(permission, project_id)[source]

Checks if given permission is granted to the current user.

Parameters:
  • permission – the permission to check.

  • project_id – the id of the project to check the permission in, None to check global permissions.

Returns:

bool

References

Security.hasCurrentUserPermission

logged_in_user_id = 'POLARION_USERNAME'
reload()[source]

Reloads the object with data from the server. This function is useful if the data on the server changed or if a data changing function was called (such as TestRun.add_attachment)

Notes

This will overwrite any unsaved data in the object.

Parameters:

None

Returns:

None

repo = 'https://polarion.engineering.redhat.com/repo'
session = <pylero.session.Session object>
class pylero.base_polarion.ClassProperty(fget=None, fset=None, fdel=None, doc=None)[source]

Bases: property

Returns a classmethod as the getter so that the property can be used as a class property. This is needed so that the property can be set for all child objects. This project currently has no need of a setter or deleter.

class pylero.base_polarion.Configuration[source]

Bases: object

CONFIG_SECTION = 'webservice'
CURDIR_CONFIG = '.pylero'
GLOBAL_CONFIG = '/home/wayne/.local/share/virtualenvs/pylero-mnliz9Ju/lib/python3.12/site-packages/pylero/pylero.cfg'
LOCAL_CONFIG = '/home/wayne/.pylero'
__init__()[source]
pkgdir = '/home/wayne/.local/share/virtualenvs/pylero-mnliz9Ju/lib/python3.12/site-packages/pylero'
class pylero.base_polarion.Connection[source]

Bases: object

Creates a Polarion session as a class method, so that it is used for all objects inherited by BasePolarion. The url, repo, user and password are read from config files, which are located either the current directory ./pylero, the user’s dir ~/.pylero or the Library config dir LIBDIR/pylero.cfg These can also be overridden with the following environment variables: POLARION_URL POLARION_REPO POLARION_USERNAME POLARION_PASSWORD POLARION_TOKEN POLARION_TIMEOUT POLARION_PROJECT

connected = True
retries = 3
session = <pylero.session.Session object>
token_enabled = False
pylero.base_polarion.tx_wrapper(func)[source]

pylero.baseline module

class pylero.baseline.Baseline(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:Baseline class

author
Type:

User

base_revision
Type:

string

description
Type:

string

baseline_id
Type:

string

name
Type:

string

project
Type:

Project

classmethod create(project_id, name, description, revision)[source]

class method create Creates a Baseline from head or particular revision.

Parameters:
  • project_id

  • name – baseline name (not None)

  • description – baseline description (can be None)

  • revision – revision or null value for head revision

Returns:

Baseline object

References

Tracker.createBaseline

classmethod query(query, sort='baseline_id')[source]

Queries for baselines.

Parameters:
  • query – the lucene query to be used.

  • sort – the field to be used for sorting.

Returns:

list of Baselines

References

Tracker.queryBaselines

pylero.build module

class pylero.build.Build(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns2:Build class

author
Type:

User

bir_location
Type:

Location

build_descriptor_name
Type:

string

build_stamp
Type:

string

build_status
Type:

string

build_tag
Type:

string

build_test_results
Type:

BuildTestResults

calculation_descriptor_name
Type:

string

creation_time
Type:

dateTime

finish_time
Type:

dateTime

build_id
Type:

string

job_id
Type:

string

linked_work_items
Type:

ArrayOfBuildLinkedWorkItem

local_deployment_space_name
Type:

string

log_files
Type:

ArrayOfLocation

start_time
Type:

dateTime

pylero.build_linked_work_item module

class pylero.build_linked_work_item.ArrayOfBuildLinkedWorkItem(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.build_linked_work_item.BuildLinkedWorkItem(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns2:BuildLinkedWorkItem class

revision
Type:

string

role
Type:

EnumOptionId

work_item
Type:

WorkItem

pylero.build_test_results module

class pylero.build_test_results.BuildTestResults(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns2:BuildTestResults class

error_count
Type:

int

failure_count
Type:

int

skipped_count
Type:

int

test_count
Type:

int

pylero.category module

class pylero.category.ArrayOfCategory(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.category.Category(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:Category class

description
Type:

Text

category_id
Type:

string

name
Type:

string

pylero.change module

class pylero.change.Change(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:Change class

creation
Type:

boolean

date
Type:

dateTime

diffs
Type:

ArrayOf_tns3_FieldDiff

empty
Type:

boolean

invalid
Type:

boolean

revision
Type:

string

user
Type:

string

pylero.comment module

class pylero.comment.ArrayOfComment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.comment.Comment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:Comment class

author
Type:

User

child_comment_uris
Type:

ArrayOfSubterraURI

created
Type:

dateTime

comment_id
Type:

string

parent_comment_uri
Type:

SubterraURI

resolved
Type:

boolean

signature_data
Type:

SignatureData

tags
Type:

ArrayOfEnumOptionId

text
Type:

Text

title
Type:

string

visible_to
Type:

ArrayOfstring

pylero.custom module

class pylero.custom.ArrayOfCustom(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.custom.Custom(key=None, value=None, suds_object=None)[source]

Bases: BasePolarion

Object to manage Polarion TestManagement WS tns4:Custom

key
Type:

string

value
Type:

EnumOptionId

__init__(key=None, value=None, suds_object=None)[source]

pylero.custom_field module

class pylero.custom_field.CustomField(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:CustomField class

key
Type:

string

parent_item_uri
Type:

string

value
Type:

anyType

pylero.custom_field_type module

class pylero.custom_field_type.CustomFieldType(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:CustomFieldType class

default_value
Type:

anyType

depends_on
Type:

string

description
Type:

string

cft_id
Type:

string

name
Type:

string

required
Type:

boolean

type
Type:

string

pylero.document module

class pylero.document.Document(project_id=None, doc_with_space=None, fields=None, uri=None, suds_object=None)[source]

Bases: BasePolarion

An object to manage the TestManagement WS tns4:Module

allowed_wi_types
Type:

ArrayOfEnumOptionId

Type:

boolean

author
Type:

User

auto_suspect
Type:

boolean

branched_from
Type:

Module

branched_with_query
Type:

string

comments
Type:

ArrayOfModuleComment

created
Type:

dateTime

custom_fields
Type:

ArrayOfCustom

derived_fields
Type:

ArrayOfstring

Type:

EnumOptionId

derived_from_uri
Type:

SubterraURI

home_page_content
Type:

Text

id
Type:

string

location
Type:

Location

module_absolute_location
Type:

Location

module_folder
Type:

string

module_location
Type:

Location

module_name
Type:

string

project
Type:

Project

signature_contexts
Type:

ArrayOfSignatureContext

status
Type:

EnumOptionId

Type:

EnumOptionId

title
Type:

string

type
Type:

EnumOptionId

updated
Type:

dateTime

updated_by
Type:

User

uses_outline_numbering
Type:

boolean

classmethod URI_ID_GET_REPLACE(x)
classmethod URI_ID_SET_REPLACE(x)
URI_STRUCT = 'subterra:data-service:objects:/default/%(project)s${%(obj)s}{moduleFolder}%(id)s'
__init__(project_id=None, doc_with_space=None, fields=None, uri=None, suds_object=None)[source]

constructor for the Module object. Gets the module object from the Polarion server based on parameters passed in.

Parameters:
  • project_id – the project where the module is located

  • doc_with_space – specific space/doc_name of the repository, required if project_id is given (Testing, Development, …)

  • fields – optional list of fields that should be contained in the returned object.

  • uri – The Polarion specific uri of the module object

  • suds_object – the WSDL Module object

Returns:

None

References

Tracker.getModuleByLocation Tracker.getModuleByLocationWithFields Tracker.getModuleByUri Tracker.getModuleByUriWithFields

add_referenced_work_item(work_item_id)[source]

Adds a work item to the document as a referenced work_item to the end of the current document.

Parameters:
  • work_item_id (str) – the id of a work item in the same project as

  • document (the current)

Returns:

None

classmethod create(project_id, space, document_name, document_title, allowed_wi_types, document_type, structure_link_role='parent', home_page_content='')[source]

class method create Creates a document or an old-style Module/Document in given location with given parameters.

Parameters:
  • project_id – project to create module in

  • space – document space location with one component or None for default space

  • document_name – Document name (required)

  • document_title – Document title (required)

  • allowed_wi_types – list of types, only one should be specified

  • document_type – Type of document (required i.e testspecification).

  • structure_link_role – required, role which defines the hierarchy of work items inside the Module, default: parent

  • home_page_content – HTML markup for document home page, default “”

Returns:

None

References

Tracker.createDocument

create_work_item(parent_id, w_item)[source]

create a work item in the current document

Parameters:
  • parent_id – The work_item_id of the parent _WorkItem

  • wi – The Work Item object to create.

Returns:

The created _WorkItem

References

Tracker.createWorkItemInModule

delete()[source]

delete the current document

Parameters:

None

Returns:

None

classmethod export_pdf(uri, exportPdfProperties, output_dir='/tmp', output_name='')[source]

Export a document to PDF and download it

Parameters:
  • uri – Module/Document URI

  • exportPdfProperties – Export parameters such as: paperSize - the size of the page for export. Possible values are A4, A3, Letter, Legal, Tabloid orientation - the orientation of the page. Possible values are Portrait or Landscape fitToPageWidth - true to fit to the page width generateBookmarks - true to generate bookmarks includeHeaderFooter - true to include header, footer and watermark

  • output_dir – the destination of the PDF file

  • output_name – name of the document (optional)

Returns:

Path to the output file

References

exportDocumentToPDF

classmethod get_documents(project_id, space, fields=[])[source]

returns a list of Document objects

Parameters:
  • project_id – the project where the modules are located

  • space – specific location of the repository

  • fields – optional list of fields that should be contained in the returned objects.

Returns:

list of Document Objects

References

Tracker.getModules Tracker.getModulesWithFields

get_work_items(parent_work_item_id, deep, fields=['work_item_id', 'type'])[source]

Returns work items (with given fields set) contained in given Module/Document under given parent (if specified).

Parameters:
  • parent_work_item_id (str) – Id of parent work item or None

  • deep – true to return work items from the whole subtree

  • fields – fields to fill. For nested structures in the lists you can use following syntax to include only subset of fields: myList.LIST.key (e.g. linkedWorkItems.LIST.role).

Returns:

list of _WorkItem objects

References

Tracker.getModuleWorkItems

move_work_item_here(work_item_id, parent_id, position=-1, retain_flow=True)[source]

Moves a work item to a specific position in a Document. If the work item is not yet inside the Document it will be moved into the Document.

Parameters:
  • work_item_id – WorkItem id to move

  • parent_id – The parent WorkItem id, can be None

  • position (int) – desired position in the list of children or a value < 0 to insert at the end (if the old and new parent is the same then moved work item is not counted)

  • retain_flow (bool) – true to retain the position of moved work item in the document flow (even if it means to change the parent). false to keep desired parent (even if it means to move work item to different position)

Returns:

None

References

Tracker.moveWorkItemToDocument

classmethod query(query, is_sql=False, fields=['document_id'], sort='document_id', limit=-1, baseline_revision=None, query_uris=False)[source]

Searches for Modules/Documents.

Parameters:
  • query – query, either Lucene or SQL

  • is_sql (bool) – determines if the query is SQL or Lucene

  • fields – list of field names to fill in the returned Modules/Documents (can be null). For nested structures in the lists you can use following syntax to include only subset of fields: myList.LIST.key (e.g. linkedWorkItems.LIST.role). For custom fields you can specify which fields you want to be filled using following syntax: customFields.CUSTOM_FIELD_ID (e.g. customFields.risk). default: list containing “document_id”

  • sort – Lucene sort string, default: document_id

  • limit – how many results to return (-1 means everything (default))

  • baseline_revision (str) – if populated, query done in specified rev default - None

  • query_uris – returns a list of URI of the Modules found, instead of a list of Documents. default - False.

Returns:

list of modules

References

queryModuleUris queryModuleUrisBySQL queryModuleUrisInBaseline queryModuleUrisInBaselineBySQL queryModules queryModulesBySQL queryModulesInBaseline queryModulesInBaselineBySQL

update()[source]

updates the server with the current module data

Parameters:

None

Returns:

None

References

Tracker.updateModule

pylero.enum_custom_field_type module

class pylero.enum_custom_field_type.EnumCustomFieldType(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:EnumCustomFieldType class

default_value
Type:

anyType

depends_on
Type:

string

description
Type:

string

enum_id
Type:

string

id
Type:

string

name
Type:

string

required
Type:

boolean

type
Type:

string

pylero.enum_option module

class pylero.enum_option.EnumOption(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:EnumOption class

default
Type:

boolean

enum_id
Type:

string

hidden
Type:

boolean

enum_option_id
Type:

string

name
Type:

string

phantom
Type:

boolean

properties
Type:

Properties

sequence_number
Type:

int

pylero.enum_option_id module

class pylero.enum_option_id.ArrayOfEnumOptionId(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

An object to manage Polarion TestManagement tns4:ArrayOfEnumOptionId

class pylero.enum_option_id.EnumOptionId(enum_id=None, suds_object=None)[source]

Bases: BasePolarion

An object to manage Polarion TestManagement tns4:EnumOptionId

__init__(enum_id=None, suds_object=None)[source]

pylero.exceptions module

exception pylero.exceptions.PyleroLibException[source]

Bases: Exception

pylero.externally_linked_work_item module

class pylero.externally_linked_work_item.ArrayOfExternallyLinkedWorkItem(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.externally_linked_work_item.ExternallyLinkedWorkItem(project_id=None, work_item_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:ExternallyLinkedWorkItem class

role
Type:

EnumOptionId

work_item_uri
Type:

string

__init__(project_id=None, work_item_id=None, suds_object=None)[source]

pylero.field_diff module

class pylero.field_diff.FieldDiff(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:FieldDiff class

added
Type:

ArrayOf_xsd_anyType

after
Type:

anyType

before
Type:

anyType

collection
Type:

boolean

field_name
Type:

string

removed
Type:

ArrayOf_xsd_anyType

pylero.imported_comment module

class pylero.imported_comment.ImportedComment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:ImportedComment class

author
Type:

string

created
Type:

dateTime

initials
Type:

string

pylero.language_definition module

class pylero.language_definition.LanguageDefinition(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:LanguageDefinition class

language_definition_id
Type:

string

label
Type:

string

pylero.license_info module

class pylero.license_info.LicenseInfo(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:LicenseInfo class

license
Type:

string

slots
Type:

int

pylero.linked_work_item module

class pylero.linked_work_item.ArrayOfLinkedWorkItem(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.linked_work_item.LinkedWorkItem(project_id=None, work_item_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:LinkedWorkItem class

revision
Type:

string

role
Type:

EnumOptionId

suspect
Type:

boolean

work_item_id
Type:

string

__init__(project_id=None, work_item_id=None, suds_object=None)[source]

pylero.module_comment module

class pylero.module_comment.ArrayOfModuleComment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.module_comment.ModuleComment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:ModuleComment class

author
Type:

User

child_comment_uris
Type:

ArrayOfSubterraURI

created
Type:

dateTime

module_comment_id
Type:

string

imported_comment
Type:

ImportedComment

parent_comment_uri
Type:

SubterraURI

referred_work_item_uri
Type:

SubterraURI

resolved
Type:

boolean

signature_data
Type:

SignatureData

tags
Type:

ArrayOfEnumOptionId

text
Type:

Text

pylero.plan module

class pylero.plan.ArrayOfPlan(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.plan.Plan(plan_id=None, project_id=None, uri=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns6:Plan class

allowed_types
Type:

ArrayOfEnumOptionId

author_uri
Type:

SubterraURI

calculation_type
Type:

EnumOptionId

capacity
Type:

float

color
Type:

string

created
Type:

dateTime

custom_fields
Type:

ArrayOfCustom

default_estimate
Type:

float

description
Type:

Text

due_date
Type:

date

estimation_field
Type:

string

finished_on
Type:

dateTime

is_template
Type:

boolean

location
Type:

Location

name
Type:

string

parent
Type:

Plan

plan_id
Type:

string

previous_time_spent
Type:

duration

prioritization_field
Type:

string

project_uri
Type:

SubterraURI

records
Type:

ArrayOfPlanRecord

sort_order
Type:

int

start_date
Type:

date

started_on
Type:

dateTime

status
Type:

EnumOptionId

template_uri
Type:

SubterraURI

updated
Type:

dateTime

__init__(plan_id=None, project_id=None, uri=None, suds_object=None)[source]

Plan Constructor

Parameters:
  • plan_id – ID of the plan

  • project_id – ID of the project that contains the specific plan required when plan_id is given

  • uri – the SubterraURI of the plan to load

  • suds_object – the Polarion Plan object

Returns:

None

References

Planning.getPlanById Planning.getPlanByUri

add_plan_items(work_items)[source]

Add plan records to the plan.

Parameters:

items – list of work_item_ids

Returns:

None

References

Planning.addPlanItems

classmethod create(plan_id, plan_name, project_id, parent_id, template_id)[source]

Creates a new plan

Parameters:
  • plan_id (str) – The id of the new plan

  • plan_name – The name of the new plan

  • project_id (str) – The project the plan will be created in

  • parent_id – The id of the parent plan (can be null)

  • template_id – The id of the template used for this plan

Returns:

Plan Object

References

Planning.createPlan

classmethod create_plan_template(template_id, template_name, project_id, parent_id)[source]

Creates a new plan template

Parameters:
  • template_id (str) – The id of the new template

  • template_name – The name of the new template

  • project_id (str) – The project the plan will be created in

  • parent_id – The id of the template the new template is based on (can be null)

Returns:

Plan Object

References

Planning.createPlanTemplate

classmethod delete_plans(project_id, plan_ids)[source]

Delete specified plans

Parameters:
  • project_id – the project the plans will be deleted in

  • plan_ids – list of plan ids to delete.

Returns:

None

References

Planning.deletePlans

get_statistics()[source]

get statistics of the plan

Parameters:

None

Returns:

PlanStatistics object

References

Planning.getPlanStatistics

get_wiki_content()[source]

Returns the wiki content of the plan

Parameters:

None

Returns:

Text object

References

Planning.getPlanWikiContent

remove_plan_items(work_items)[source]

Remove plan records to the plan.

Parameters:

items – list of work_item_ids

Returns:

None

References

Planning.removePlanItems

classmethod search(query, sort='plan_id', limit=-1, fields=[], search_templates=False)[source]

search plans or plan templates

Args

query sort limit: the maximum number of records to be returned, -1 for no limit. fields: list of the fields requested.

Returns:

list of Plan objects

References

Planning.searchPlanTemplates Planning.searchPlanTemplatesWithFields Planning.searchPlans Planning.searchPlansWithFields

set_wiki_content(content)[source]

method set_wiki_content updates the wiki for the current Plan

Parameters:

Content (str or Text object)

Returns:

None

References

Planning.setPlanWikiContent

update()[source]

updates the server with the current plan content

Parameters:

None

Returns:

None

References

Planning.updatePlan

was_started()[source]

checks if the plan was started yet

Parameters:

None

Returns:

bool

References

Planning.wasPlanStarted

pylero.plan_record module

class pylero.plan_record.ArrayOfPlanRecord(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.plan_record.PlanRecord(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns6:PlanRecord class

item
Type:

_WorkItem

pylero.plan_statistics module

class pylero.plan_statistics.PlanStatistics(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:PlanStatistics class

done
Type:

float

done_as_string
Type:

string

ideal_progress
Type:

float

ideal_progress_as_string
Type:

string

number_of_planned
Type:

int

number_of_resolved
Type:

int

number_of_unresolved
Type:

int

planned
Type:

float

planned_as_string
Type:

string

progress
Type:

float

progress_as_string
Type:

string

todo
Type:

float

todo_as_string
Type:

string

pylero.planning_constraint module

class pylero.planning_constraint.ArrayOfPlanningConstraint(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.planning_constraint.PlanningConstraint(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:PlanningConstraint class

constraint
Type:

EnumOptionId

date
Type:

dateTime

pylero.priority_opt module

class pylero.priority_opt.PriorityOpt(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:PriorityOpt class

default
Type:

boolean

enum_id
Type:

string

float
Type:

float

hidden
Type:

boolean

priority_opt_id
Type:

string

name
Type:

string

phantom
Type:

boolean

properties
Type:

Properties

sequence_number
Type:

int

pylero.priority_option_id module

class pylero.priority_option_id.ArrayOfPriorityOptionId(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.priority_option_id.PriorityOptionId(id=None, uri=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:PriorityOptionId class

id
Type:

string

__init__(id=None, uri=None, suds_object=None)[source]

PriorityOptionID Constructor

Parameters:
  • id – value of the priority

  • uri – the SubterraURI of the priority

  • suds_object – the Polarion Plan object

Returns:

None

References

_WorkItem.priority

pylero.product_license module

class pylero.product_license.ProductLicense(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:ProductLicense class

concurrent_license_data
Type:

ArrayOf_tns3_LicenseInfo

customer_company
Type:

string

customer_email
Type:

string

customer_name
Type:

string

date_created
Type:

dateTime

expiration_date
Type:

dateTime

generated_by
Type:

string

ip_address
Type:

string

license_format
Type:

string

license_profile
Type:

string

mac_address
Type:

string

named_license_data
Type:

ArrayOf_tns3_LicenseInfo

pylero.project module

class pylero.project.Project(project_id=None, suds_object=None, location=None, uri=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:Project class

active
Type:

boolean

description
Type:

Text

finish
Type:

date

lead
Type:

User

location
Type:

str

lock_work_records_date
Type:

date

name
Type:

string

project_group
Type:

ProjectGroup

project_id
Type:

string

start
Type:

date

tracker_prefix
Type:

string

URI_STRUCT = 'subterra:data-service:objects:/default/%(id)s${%(obj)s}%(id)s'
__init__(project_id=None, suds_object=None, location=None, uri=None)[source]

Project constructor.

Parameters:
  • project_id – when given, the object is populated with the Project data.

  • suds_object – PolarionProject object. When given, the object is populated by object data.

  • location – the location of the Polarion project

  • uri – the uri that references the PolarionProject

Notes

Either project_id or suds_object or location or uri can be passed in or none of them. If none of the identifying parameters are passed in an empty object is created

References

Project.getProject Project.getProjectAtLocation Project.getProjectByURI

get_categories()[source]

method get_categories retrieves a list of Category objects

Parameters:

None

Returns:

list of Category objects

References

Tracker.getCategories

classmethod get_context_roles(location)[source]

Returns the context (project) roles for the given location.

Parameters:

location – the location of the context (project/project group)

Returns:

list of roles

References

Security.getContextRoles

get_defined_custom_field_keys(work_item_type_id)[source]

Gets all custom field keys defined for a workitem type in a project.

Parameters:

work_item_type_id – the workitem type ID.

Returns:

list of key for the project for the given workitem type

References

Tracker.getDefinedCustomFieldkeys

get_defined_custom_field_type(work_item_type_id, key)[source]

method get_defined_custom_field_type gets custom field definition of a work item type for the given key.

Parameters:
  • work_item_type_id – the workitem type ID.

  • key – The key of the custom field

Returns:

CustomFieldType object

References

Tracker.getDefinedCustomFieldType

get_defined_custom_field_types(work_item_type_id)[source]

method get_defined_custom_field_type gets custom field definition of a work item type all keys.

Parameters:

work_item_type_id – the workitem type ID.

Returns:

list of CustomFieldType object

References

Tracker.getDefinedCustomFieldType

get_document_spaces()[source]

Gets the Module/Document spaces for the project.

Parameters:

None

Returns:

list of (string) document spaces

References

Tracker.getDocumentSpaces

get_project_users()[source]

Gets users of the project

Parameters:

None

Returns:

list of u.User objects

References

Project.getProjectUsers

get_test_steps_configuration()[source]

method get_test_steps_configuration retrieves a list of the Test Steps configuration for the project

Parameters:

None

Returns:

list of configuration of the Test Steps custom field.

References

TestManagement.getTestStepsConfiguration

get_tests_configuration()[source]

method get_tests_configuration retrieves the test management configuration for the project

Parameters:

None

Returns:

TestsConfiguration object

References

TestManagement.getTestsConfiguration

get_wiki_spaces()[source]

Returns Wiki spaces from current project

Parameters:

None

Returns:

Array of string

References

Tracker.getWikiSpaces

pylero.project_group module

class pylero.project_group.ProjectGroup(uri=None, location=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns2:ProjectGroup class

group_uris
Type:

ArrayOfSubterraURI

location
Type:

Location

name
Type:

string

parent_uri
Type:

SubterraURI

project_ids
Type:

ArrayOfstring

__init__(uri=None, location=None, suds_object=None)[source]

ProjectGroup constructor.

Parameters:
  • uri – the uri that references the Polarion ProjectGroup

  • location – the location of the Polarion ProjectGroup

  • suds_object – Polarion ProjectGroup object. When given, the object is populated by object data.

Notes

Either uri or suds_object or location in or none of them. If none of the identifying parameters are passed in an empty object is created

References

p.Project.getProjectGroup p.Project.getProjectGroupAtLocation

get_contained_groups()[source]

Gets all project groups located directly below the project group.

Parameters:

None

Returns:

list of p.ProjectGroup objects

References

p.Project.getContainedGroups

get_contained_projects()[source]

Gets all projects located directly below the project group.

Parameters:

None

Returns:

list of p.Project objects

References

p.Project.getContainedProjects

get_deep_contained_projects()[source]

Gets all projects located below the project group.

Parameters:

None

Returns:

list of p.Project objects

References

p.Project.getDeepContainedProjects

classmethod get_root_project_group()[source]

Gets the root project group.

Parameters:

None

Returns:

ProjectGroup object

References

Project.getRootProjectGroup

pylero.properties module

class pylero.properties.Properties(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:Properties class

property
Type:

property

pylero.property module

class pylero.property.Property(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:property class

key
Type:

string

value
Type:

string

pylero.revision module

class pylero.revision.ArrayOfRevision(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.revision.Revision(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:Revision class

author
Type:

string

created
Type:

dateTime

internal_commit
Type:

boolean

linked_work_item_uris
Type:

ArrayOfSubterraURI

message
Type:

string

name
Type:

string

repository_name
Type:

string

classmethod query(query, sort='name', fields=['name'], query_uris=False)[source]

Searches revisions

Parameters:
  • query – query, Lucene

  • sort – Lucene sort string, default - name

  • fields – list of field names to fill in the returned Revision (can be null). For nested structures in the lists you can use following syntax to include only subset of fields: myList.LIST.key (e.g. linkedWorkItems.LIST.role). For custom fields you can specify which fields you want to be filled using following syntax: customFields.CUSTOM_FIELD_ID (e.g. customFields.risk). Default - list containing “name”

  • query_uris – if True, returns a list of URIs instead of Revision objects. default - False

Returns:

list of Revisions

References

Tracker.queryRevisions

pylero.server module

class pylero.server.Server(url, user, password, token, default_project=None, relogin_timeout=60, timeout=120, cert_path=None)[source]

Bases: object

Server object is instantiated once per Polarion session and creates the session that is used to connect to the server.

__init__(url, user, password, token, default_project=None, relogin_timeout=60, timeout=120, cert_path=None)[source]

An object that defines the properties of the Polarion server to connect to.

Parameters:
  • url – url of the Polarion server

  • user – username

  • password – password

  • default_project – default project to use to for configuarations

  • relogin_timeout – timeout after which the session will try to login again

  • timeout – http tiemout

  • cert_path – path to customize CA bundle

session()[source]

pylero.session module

class pylero.session.ListenFilter(name='')[source]

Bases: Filter

filter(record)[source]

Determine which log records to output. Returns 0 for no, nonzero for yes.

class pylero.session.Session(server, timeout)[source]

Bases: object

__init__(server, timeout)[source]

Session constructor, initialize the WSDL clients

Parameters:
  • server – server object that the session connects to

  • caching_policy – determines the caching policy of the SUDS conn

  • timeout – HTTP timeout for the connection

tx_begin()[source]
tx_commit()[source]
tx_in()[source]

Function checks if a transaction is in progress. You can not have a transaction within another transaction. This function helps the system determine if it should start a new transaction or if it is already in the middle of one.

Returns:

bool

tx_release()[source]
tx_rollback()[source]
class pylero.session.SoapNull[source]

Bases: MessagePlugin

suds plugin that is called before any suds message is sent to the remote server. It adds the xsi:nil=true attribute to any element that is blank. Without this plugin, a number of functions that were supposed to accept null parameters did not work.

add_nil(element)[source]

Used as a filter function with walk to add xsi:nil to blank attrs.

marshalled(context)[source]

Suds is about to send the specified SOAP envelope.

Provides the plugin with the opportunity to inspect/modify the envelope Document before it is sent.

@param context: The send context.

The I{envelope} is the envelope document.

@type context: L{MessageContext}

pylero.session.create_ssl_context()[source]

this function creates a custom ssl context which is required for ssl connection in python-version >=2.7.10. this ssl context is customize to use certificate which is located in ‘CERT_PATH’.

pylero.signature module

class pylero.signature.ArrayOfSignature(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.signature.Signature(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:Signature class

signed_by
Type:

User

signed_revision
Type:

string

signer_role
Type:

string

verdict
Type:

EnumOptionId

verdict_time
Type:

dateTime

pylero.signature_context module

class pylero.signature_context.ArrayOfSignatureContext(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.signature_context.SignatureContext(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:SignatureContext class

signatures
Type:

ArrayOfSignature

target_status_id
Type:

string

transition_data_revision
Type:

string

user
Type:

User

pylero.signature_data module

class pylero.signature_data.SignatureData(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:SignatureData class

target_status_id
Type:

string

verdict
Type:

EnumOptionId

pylero.subterra_uri module

class pylero.subterra_uri.ArrayOfSubterraURI[source]

Bases: BasePolarion

__init__()[source]
class pylero.subterra_uri.SubterraURI[source]

Bases: BasePolarion

__init__()[source]

pylero.test_record module

class pylero.test_record.ArrayOfTestRecord(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.test_record.TestRecord(project_id=None, test_case_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:TestRecord class

Attributes (for specific details, see Polarion):

attachments (ArrayOfTestRunAttachment) comment (Text) defect_case_id (string) duration (float) executed (dateTime) executed_by (string) result (EnumOptionId) test_case_revision (string) test_case_id (string) test_step_results (ArrayOfTestStepResult)

__init__(project_id=None, test_case_id=None, suds_object=None)[source]

pylero.test_run module

class pylero.test_run.TestRun(test_run_id=None, suds_object=None, project_id=None, uri=None)[source]

Bases: BasePolarion

Object to manage the Polarion Test Management WS tns3:TestRun

attachments
Type:

list of TestRunAttachments

author

user object of the Test Run Author

Type:

User

created
Type:

datetime

document
Type:

Module

finished_on
Type:

datetime

group_id
is_template

indicates if the TestRun object is a Template

Type:

bool

keep_in_history
Type:

bool

location
project
Type:

Project

query

The Polarion query that the TestRun objects are based on.

Type:

str

records
Type:

list of TestRecord objects

select_test_cases_by
The test cases can be:

AUTOMATED_PROCESS DYNAMIC_QUERY DYNAMIC_LIVEDOC MANUAL_SELECTION STATIC_QUERY STATIC_LIVEDOC

Type:

EnumOptionId

status
summary_defect
Type:

_WorkItem

template

template that the TestRun is based on.

Type:

TestRun

test_run_id

Unique identifier of the test run within the project

Type:

str

type
updated
custom_fields
__init__(test_run_id=None, suds_object=None, project_id=None, uri=None)[source]

TestRun constructor.

Parameters:
  • test_run_id – when given, the object is populated with the TestRuns. Requires project_id parameter

  • suds_object – Polarion TestRun object. When given, the object is populated by object data.

  • project_id – the Polarion project that the Test Run is located in. Required if test_run_id is passed in

  • uri – the uri that references the Polarion TestRun

Notes

Either test_run_id and project or suds_object or uri can be passed in or none of them. If none of the identifying parameters are passed in an empty object is created

References

test_management.getTestRunById test_management.getTestRunByUri

add_attachment(path, title)[source]

method add_attachment adds the given attachment to the current test run

Parameters:
  • path – file path to upload

  • title – u.User friendly name of the file

Returns:

None

Notes

Raises an error if the test run object is not populated

References

test_management.addAttachmentToTestRun

add_attachment_to_test_record(test_case_id, path, title)[source]

method add_attachment_to_test_record, adds the given attachment to the specified test record

Parameters:
  • test_case_id (str) – The id of the test case

  • path – file path to upload

  • title – u.User friendly name of the file

Returns:

None

Notes

Raises an error if the test case given is not in the TestRun or has not been executed yet.

References

test_management.addAttachmentToTestRecord

add_attachment_to_test_step(test_case_id, test_step_index, path, title)[source]

method add_attachment_to_test_step, adds the given attachment to the specified test step of the specified test record

Parameters:
  • test_case_id (str) – The id of the test case to the step is in

  • test_step_index (int) – The 0 based index of the test step

  • path – file path to upload

  • title – u.User friendly name of the file

Returns:

none

Notes

Raises an error if the record_index given is higher then the number of test records. or if the test_step_index is higher then the number of steps.

References

test_management.addAttachmentToTestStep

add_test_record_by_fields(test_case_id, test_result, test_comment, executed_by, executed, duration, defect_work_item_id=None)[source]

method add_test_record_by_fields, adds a test record for the given test case based on the result fields passed in. When a test record is added and the valid options for status contain “inprogress” and “finished”, it changes the test run status to “inprogress” and when the last test record is run, it changes the status to “finished”.

Parameters:
  • test_case_id (str) – The id of the test case that was executed

  • test_result (str) – Must be one of the following values: passed failed blocked

  • test_comment (str or Text object) – may be None

  • executed_by (str) – user id

  • executed (datetime)

  • duration (float)

  • defect_work_item_id (str) – _WorkItem id of defect, default: None

Returns:

None

References

test_management.addTestRecordToTestRun

add_test_record_by_object(test_record, manual_state_change=False, create_incident=True)[source]

method add_test_record_by_object, adds a test record for the given test case based on the TestRecord object passed in. In addition, the test run is checked for completeness and the test run state will change accordingly. If possible, the status is set to one of [“notrun”, “finished”, “inprogress”].

Parameters:
  • test_record (TestRecord or Polarion TestRecord)

  • manual_state_change (boolean) – Change test run state automatically or manual.

  • create_incident (boolean) – Create an incident report if the test case fails and no incident is linked.

Returns:

None

References

test_management.addTestRecordToTestRun

classmethod create(project_id, test_run_id=None, template=None, title=None, **kwargs)[source]

class method create for creating a new test run in Polarion

Parameters:
  • project_id (string) – the Polarion project to create the test run in

  • test_run_id (string) – the unique identifier for the test run, If the Enable Generated Test Run IDs option is marked in the configuration, it will ignore this field. If it is None, the title will be used.

  • template (string) – the id of the template to base the test run on. cannot be None. Because of the existing order of params before adding title, it is given a default value of None, which will cause an error if it is not populated

  • title (string) – To create a test run with a title. In this case, if the id is not populated it will be autogen. If it is populated, it will use that.

  • **kwargs – keyword arguments. Test run attributes can be passed in to be set upon creation. Required fields must be passed in

Returns:

The created TestRun object

References

test_management.createTestRun

create_summary_defect(defect_template_id=None)[source]

method create_summary_defect, adds a new summary _WorkItem for the test case based on the _WorkItem template id passed in. If not template is passed in, it creates it based on the default template.

Parameters:
  • defect_template_id (str) – the _WorkItem template id to base the

  • default (new summary defect. can be null.) – None

Returns:

the created _WorkItem

References

test_management.createSummaryDefect

classmethod create_template(project_id, template_id, parent_template_id='Empty', select_test_cases_by=None, query=None, doc_with_space=None, **kwargs)[source]

class method create_template for creating a new template in Polarion

Parameters:
  • project_id (string) – the Polarion project to create the test run in

  • template_id (string) – the unique identifier for the template

  • parent_template_id – the template that this is based on Default: “Empty”

  • select_test_cases_by – the method used to choose test cases NOTE: It is currently not possible to select test cases manually via the API. Default: None

  • query – the Lucene query, for query methods, default None

  • doc_with_space – the space/doc_name, for document methods default: None

  • **kwargs – keyword arguments. Test run attributes can be passed in to be set upon creation. Required fields must be passed in

Returns:

The created TestRun Template object

References

test_management.createTestRun

delete_attachment(filename)[source]

Deletes Test Run Attachment specified by attachment’s file name. Method is applicable also on Test Run Template.

Parameters:

filename – filename to delete

Returns:

None

References

test_management.deleteTestRunAttachment

delete_attachment_from_test_record(test_case_id, filename)[source]

Deletes Test Record Attachment of specified record and attachment’s file name.

Parameters:
  • test_case_id – The test case to delete the attachment from

  • filename – name of the file to delete

Returns:

None

References

test_management.deleteAttachmentFromTestRecord

delete_attachment_from_test_step(test_case_id, test_step_index, filename)[source]

Deletes Test Step Attachment of the specified step in the specified test record.

Parameters:
  • test_case_id – The test case to delete the attachment from

  • filename – name of the file to delete

Returns:

None

References

test_management.deleteAttachmentFromTestRecord

get_attachment(filename)[source]

Gets Test Run Attachment specified by attachment’s file name. Method is applicable also on Test Run Template.

Parameters:

filename – filename to delete

Returns:

TestRunAttachment object

References

test_management.getTestRunAttachment

get_attachments()[source]

method get_attachments returns all the attachments for the TestRun

Parameters:

None

Returns:

ArrayOfTestRunAttachments object

References

test_management.getTestRunAttachments

get_custom_field(field_name)[source]

gets custom field values.

Parameters:

field_name – name of the custom field

Returns:

value of the custom field.

Note: Polarion WSDL currently does not publish the list of custom

fields, so this function cannot do any verification if the field is valid.

classmethod get_defined_custom_field_types(project_id)[source]

Gets all the custom fields defined for the specified project. the custom fields are all either of type CustomFieldType or EnumCustomFieldType in the case where the field is an enumeration. These 2 classes are mostly interchangeable.

Parameters:

project_id – the project to get the custom fields from

Returns:

list of all the custom fields

References

testmanagement.getDefinedTestRunCustomFieldTypes

get_wiki_content()[source]

method get_wiki_content returns the wiki content for the Test Run

Parameters:

None

Returns:

Text object containing the wiki content

References

test_management.getWikiContentForTestRun

property records

function to return all the test records of a TestRun. The records array for dynamic queries/documents only includes executed records. This returns the unexecuted ones as well.

Parameters:

None

Returns:

list of TestRecords

classmethod search(query, fields=['test_run_id'], sort='test_run_id', limit=None, search_templates=False, project_id=None)[source]

class method search executes the given query and returns the results

Parameters:
  • query – the Polarion query used to find test runs

  • fields – test run fields that should be initialized, all other fields will be null. Field names are from the object’s attributes and not the Polarion field names, default [“test_run_id”]. If you want all of the fields to be returned, pass [] for this parameter.

  • sort – the field used to sort results, default is test_run_id

  • limit (int) – the maximum number of records to be returned, -1 for no limit, default None.

  • search_templates (bool) – if set, searches the templates instead of the test runs, default False

  • project_id – if set, searches the project id, else default project

Returns:

list of TestRun objects

References

test_management.searchTestRunTemplates test_management.searchTestRunTemplatesLimited test_management.searchTestRunTemplatesWithFields test_management.searchTestRunTemplatesWithFieldsLimited test_management.searchTestRuns test_management.searchTestRunLimited test_management.searchTestRunsWithFields test_management.searchTestRunsWithFieldsLimited

update()[source]

method update updates the testRun object with the attribute values currently in the object.

Parameters:

None

Returns

None

References

test_management.updateTestRun

update_attachment(path, original_filename, title)[source]

method update_attachment updates the specified attachment to the current test run

Parameters:
  • path – file path to upload

  • original_filename – The file that we want to overwrite with the new file

  • title – u.User friendly name of the file

Returns:

None

Notes

Raises an error if the test run object is not populated.

References

test_management.updateTestRunAttachment

update_summary_defect(source, total_failures, total_errors, total_tests, defect_template_id)[source]

method update-summary_defect creates or updates the summary defect Work Item of a test run.

Parameters:
  • source (string) – source of the summary defect, used to generate the description content.

  • total_failures (int) – amount of total failures in the test run, used to generate the description content.

  • total_errors (int) – amount of total errors in the test run, used to generate the description content.

  • total_tests (int) – amount of total tests in the test run, used to generate the description content.

  • defect_template_id – ID of the defect template Work Item to be used, the configured template will be used if None.

Returns:

the created or updated _WorkItem

References

test_management.updateSummaryDefect

update_test_record_by_fields(test_case_id, test_result, test_comment, executed_by, executed, duration, defect_work_item_id=None)[source]

method update_test_record_by_fields updates a test record.

Parameters:
  • test_case_id – id of the test case to update.

  • test_result – Must be one of the following values: passed failed blocked

  • test_comment – (str or Text object) - may be None

  • executed_by (str) – user id

  • executed – date when the test case has been executed

  • duration – duration of the test case execution, any negative value is treated as None.

  • defect_work_item_id – _WorkItem id of defect, can be None Default: None

Returns:

None

Notes

Only a test case that has already been executed may be updated using this function. To execute a test record use the add_test_record_by_fields function

References

test_management.updateTestRecord

update_test_record_by_object(test_case_id, test_record, manual_state_change=False, create_incident=True)[source]

method update_test_record_by_object, adds a test record for the given test case based on the TestRecord object passed in. In addition, the test run is checked for completeness and the test run state will change accordingly. If possible, the status is set to one of [“notrun”, “finished”, “inprogress”].

Parameters:
  • test_case_id (str) – the test case id that the record is related to.

  • test_record (TestRecord or Polarion TestRecord)

  • manual_state_change (boolean) – Change the test run result automatically or manual.

  • create_incident (boolean) – Create an incident report if the test record result is failed and no defect case id is set.

Returns:

None

References

test_management.updateTestRecordAtIndex

update_wiki_content(content)[source]

method update_wiki_content updates the wiki for the current TestRun

Parameters:

Content (str or Text object)

Returns:

None

References

test_management.updateWikiContentForTestRun

verify_params(**kwargs)[source]

function that checks if all the kwargs are valid attributes.

Parameters:

**kwargs – keyword arguments. Test run attributes can be passed in to be set upon creation. Required fields must be passed in

Exceptions:

PyleroLibException - if params are unknown

verify_required()[source]

function that checks if all required fields are passed in

Exceptions:

PyleroLibException - if required params are not passed in

pylero.test_run_attachment module

class pylero.test_run_attachment.ArrayOfTestRunAttachment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.test_run_attachment.TestRunAttachment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns4:TestRunAttachment class

author
Type:

User

file_name
Type:

string

id
Type:

string

length
Type:

long

test_run_uri
Type:

SubterraURI

title
Type:

string

updated
Type:

dateTime

url
Type:

string

pylero.test_step module

class pylero.test_step.ArrayOfTestStep(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.test_step.TestStep(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:TestStep class

values
Type:

ArrayOfText

pylero.test_step_result module

class pylero.test_step_result.ArrayOfTestStepResult(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.test_step_result.TestStepResult(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:TestStepResult class

attachments
Type:

ArrayOfTestRunAttachment

comment
Type:

Text

result
Type:

EnumOptionId

pylero.test_steps module

class pylero.test_steps.TestSteps(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:TestSteps class

keys
Type:

ArrayOfEnumOptionId

steps
Type:

ArrayOfTestStep

pylero.tests_configuration module

class pylero.tests_configuration.TestsConfiguration(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:TestsConfiguration class

defect_auto_assignement_enabled
Type:

boolean

defect_reuse_type
Type:

string

defect_template
Type:

string

Type:

string

defect_work_item_type
Type:

string

defects_project
Type:

string

fields_to_copy_from_test_case_to_defect
Type:

Properties

fields_to_copy_from_test_run_to_linked_defect
Type:

Properties

fields_to_copy_from_test_run_to_new_defect
Type:

Properties

max_created_defects
Type:

int

max_created_defects_percent
Type:

int

result_error_enum_id
Type:

string

result_failed_enum_id
Type:

string

result_passed_enum_id
Type:

string

retest_allowed
Type:

boolean

status_error_enum_id
Type:

string

status_failed_enum_id
Type:

string

status_ok_enum_id
Type:

string

summary_defect_severity
Type:

string

test_case_id_custom_field
Type:

string

test_case_template
Type:

string

test_case_test_comment_field_id
Type:

string

test_case_test_result_field_id
Type:

string

test_case_work_item_type
Type:

string

test_run_template
Type:

string

pylero.text module

class pylero.text.ArrayOfText(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object containing list of Text objects

class pylero.text.Text(content=None, suds_object=None)[source]

Bases: BasePolarion

Object to manage Polarion TestManagement WS tns2:Text

Rich text object

content

the formatted text

Type:

str

content_type

indication of how content is formatted (eg. text/html)

Type:

str

content_lossy
Type:

bool

__init__(content=None, suds_object=None)[source]

pylero.time_point module

class pylero.time_point.TimePoint(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:TimePoint class

closed
Type:

boolean

description
Type:

Text

earliest_planned_start
Type:

date

time_point_id
Type:

string

name
Type:

string

time
Type:

date

pylero.user module

class pylero.user.ArrayOfUser(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.user.User(user_id=None, suds_object=None, uri=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:User class

description
Type:

Text

disabled_notifications
Type:

boolean

email
Type:

string

user_id
Type:

string

name
Type:

string

vote_uris
Type:

ArrayOfSubterraURI

watche_uris
Type:

ArrayOfSubterraURI

__init__(user_id=None, suds_object=None, uri=None)[source]

User constructor.

Parameters:
  • user_id – when given, the object is populated with user’s data

  • suds_object – Polarion User object. When given, the object is populated by object data.

  • uri – when given, the object is populated with user’s data

Notes

Either user_id, suds_object or uri can be passed in, not multiple

References

Project.getUser Project.getUserByUri

classmethod create_user(user_id)[source]

class method create_user that creates a Polarion user.

Parameters:

user_id – the id of the user to create (login name)

Returns

new User object

References

Project.createUser(java.lang.String)

get_context_roles(location)[source]

Returns the context (project) roles for the user at given location.

Parameters:

location – the location of the context (project/project group)

Returns:

list of roles

References

Security.getContextRolesForUser

get_roles(location)[source]

Returns all global and context roles for the context at given location assigned to the user.

Parameters:

location

Returns:

list of roles

References

Security.getRolesForUser

get_user_avatar_url()[source]

method get_user_avatar_url, returns a string with the relative URL of the user’s avatar.

Parameters:

None

Notes

Raises an error if the User is not populated.

References

Project.getUserAvatarURL

classmethod get_user_from_token(token)[source]

Returns the username of the user that has the assigned token.

Parameters:

token

Returns:

user_id

References

Security.getUserFromToken

classmethod get_users()[source]

class method that returns all the system users

Parameters:

None

Returns:

list containing User objects for all users.

References

Project.getUsers

has_permission(permission, project_id)[source]

Checks if given permission is granted to the user.

Parameters:
  • permission – the permission to check.

  • project_id – the id of the project to check the permission in, None to check global permissions.

Returns:

bool

References

Security.hasPermission

update()[source]

method update, updates Polarion with the User attributes

Parameters:

None

Notes

Raises an error if the User is not populated.

References

p.Project.updateUser

pylero.wiki_page module

class pylero.wiki_page.WikiPage(fields=None, uri=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:WikiPage class

attachments
Type:

ArrayOfWikiPageAttachment

author
Type:

User

created
Type:

dateTime

home_page_content
Type:

Text

wiki_page_id
Type:

string

linked_page_uris
Type:

ArrayOfSubterraURI

location
Type:

Location

page_location
Type:

Location

page_name
Type:

string

project
Type:

Project

space_id
Type:

string

title
Type:

string

type
Type:

string

updated
Type:

dateTime

updated_by
Type:

User

__init__(fields=None, uri=None, suds_object=None)[source]
Parameters:

fields – list of object fields to be returned in the object

Returns:

None

References

Tracker.getWikiPageByUri tracker.getWikiPageByUriWithFields

classmethod get_wiki_pages(project_id, space_id, fields)[source]

Returns Wiki Pages from given project and space.

Parameters:
  • project_id – project id (not null)

  • space_id – space id (not null)

Returns:

list of WikiPage objects

classmethod query(query, is_sql=False, fields=['wiki_page_id'], sort='wiki_page_id', limit=-1, baseline_revision=None, query_uris=False)[source]

Searches for Wiki Pages .

Parameters:
  • query – query, either Lucene or SQL

  • is_sql (bool) – determines if the query is SQL or Lucene

  • fields – list of field names to fill in the returned Modules/Documents (can be null). For nested structures in the lists you can use following syntax to include only subset of fields: myList.LIST.key (e.g. linkedWorkItems.LIST.role). For custom fields you can specify which fields you want to be filled using following syntax: customFields.CUSTOM_FIELD_ID (e.g. customFields.risk). default - list containing “wiki_page_id”

  • sort – Lucene sort string, default wiki_page_id

  • limit – how many results to return (-1 means everything (default))

  • baseline_revision (str) – if populated, query done in specified rev default - None

  • query_uris – returns a list of URI of the Modules found, instead of a list of WikiPage objects. default - False

Returns:

list of modules

References

queryWikiPageUris queryWikiPageUrisBySQL queryWikiPageUrisInBaseline queryWikiPageUrisInBaselineBySQL queryWikiPages queryWikiPagesBySQL queryWikiPagesInBaseline queryWikiPagesInBaselineBySQL

pylero.wiki_page_attachment module

class pylero.wiki_page_attachment.ArrayOfWikiPageAttachment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.wiki_page_attachment.WikiPageAttachment(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:WikiPageAttachment class

author
Type:

User

file_name
Type:

string

wiki_page_attachment_id
Type:

string

length
Type:

long

title
Type:

string

updated
Type:

dateTime

url
Type:

string

pylero.work_item module

class pylero.work_item.BusinessCase(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.ChangeRequest(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.Defect(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.IncidentReport(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.Requirement(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.Risk(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.Task(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.TestCase(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

class pylero.work_item.TestSuite(project_id=None, work_item_id=None, suds_object=None, uri=None, fields=None, revision=None)

Bases: _SpecificWorkItem

pylero.work_item.newclass

alias of Risk

pylero.work_record module

class pylero.work_record.ArrayOfWorkRecord(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

class pylero.work_record.WorkRecord(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns5:WorkRecord class

comment
Type:

string

date
Type:

date

work_record_id
Type:

string

time_spent
Type:

duration

type
Type:

EnumOptionId

user
Type:

User

pylero.workflow_action module

class pylero.workflow_action.WorkflowAction(obj_id=None, suds_object=None)[source]

Bases: BasePolarion

Object to handle the Polarion WSDL tns3:WorkflowAction class

action_id
Type:

int

action_name
Type:

string

cleaned_features
Type:

ArrayOf_xsd_string

native_action_id
Type:

string

required_features
Type:

ArrayOf_xsd_string

suggested_features
Type:

ArrayOf_xsd_string

target_status
Type:

EnumOptionId

unavailability_message
Type:

string

Module contents