pyats.aereport.tims package

tims – Tims

This module implements TIMS section used by TestSuite.

class pyats.aereport.tims.Tims

Bases: AEReportElement

This module implement Tims section used by TestSuite. If tims posting is enabled, this will contain result status of tims importer

Class based on the following schema definition

<xs:element name="tims">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="dnsname"></xs:element>
            <xs:element name="attribute" maxOccurs="unbounded"></xs:element>
            <xs:element name="post" type="TimsPostType"></xs:element>
        </xs:sequence>
        <xs:attribute name="bgPost" type="xs:boolean"></xs:attribute>
    </xs:complexType>
</xs:element>
tag

Default value = ‘notag’. This is to ensure that all elements contain a tag attribute.

Type:

str

attrs

Default value is None. This is to ensure that all elements contain an attrs dictionary. attrs is expanded as attributes in the xml start tag.

Type:

dict

dnsname

TIMS token id

Type:

str

attributes

TIMS global attributes

Type:

SimpleList

post

Status of ATS TIMS importer (if invoked) including the number of tests that were successfully posted to TIMS

Type:

TimsPostType

set_args(**kwargs)

Set attributes for tims

Parameters:
  • dnsname (str) – TIMS token id

  • attributes (list) – TIMS global attributes

  • post (dict) – Status of ATS TIMS importer (if invoked) including the number of tests that were successfully posted to TIMS

  • bgPost (bool) – The attribute tracks is the posting to TIMS is done actively or is posted as an independent background task

Submodules

timsattribute – TimsAttributes Class

Module author: Jean-Benoit <jeaubin@cisco.com>

This module TimsAttributes class used by Testsuite Tims

class pyats.aereport.tims.timsattributes.TimsAttribute(**kwargs)

Bases: AEReportElement

TimsAttributes TIMS global attributes Class based on the following schema definition

::
<xs:element name=”attribute” maxOccurs=”unbounded”>
<xs:annotation>

<xs:documentation>TIMS global attributes</xs:documentation>

</xs:annotation>

<xs:complexType>
<xs:simpleContent>
<xs:extension base=”xs:string”>

<xs:attribute name=”name”/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

tag

Constant value = ‘attribute’ to be used as xml tag.

Type:

str

attrs

The only key in this dictionary should be ‘name’ which is the name attribute of the timsattribute tag.

Type:

dict

value

The text value of the timsattribute element

Type:

str

generate_dom(parent)

Override the default behavior of AEReportElement.generate_dom

Parameters:

parent (AEReportElement) – The xml element that should be used as a parent for this userdef

set_args(**kwargs)

Set name and value

Parameters:
  • name (str) – Name

  • value (str) – Value

timspost –TimsPosts

This module implements TimsPost section used by Tims.

class pyats.aereport.tims.timspost.TimsPost(**kwargs)

Bases: AEReportElement

This module implement TimsPost section used by Tims. Structure for posting test result record to tims (one test record only) Class based on the following schema definition

<xs:complexType name="TimsPostType">
    <xs:sequence>
        <xs:element name="status"></xs:element>
        <xs:element name="cmd"/>
        <xs:element name="error" minOccurs="0"></xs:element>
    </xs:sequence>
</xs:complexType>
tag

Default value = ‘notag’. This is to ensure that all elements contain a tag attribute.

Type:

str

status

Result status for tims post

Type:

str

cmd
Type:

str

error

Any error message if tims importer was not successful

Type:

str

set_args(**kwargs)

Set timspost values

Parameters:
  • status (str) – Result status for tims post

  • cmd (str) – cmd

  • error (str) – error