PackageGenerator

class PackageGenerator

Returned by

Clone()

Call this method if you want to use API-objects in multiple contexts, e.g. if you want to insert a specific test step in multiple blocks.

Returns:

A copy of this object

Return type:

PackageGenerator

GenerateProject(destinationPath)

Initiates the execution of the generator and stores the result as a new project file.

Parameters:
destinationPath : str

Absolute destination path to store the project file

GetAttribute(attributeName)

Returns the value of the attribute of the given name. Value is returned as str. Examples: int 5 –> u”5” string “5” –> u“‘5’” list [1,2,3] –> u”[1,2,3]”

Parameters:
attributeName : str

Name of attribute to be returned

Returns:

attribute value

Return type:

str

GetGeneratorAttributes()

Returns all the stored attributes of the generator. Values are returned as str. Examples: int 5 –> u”5” string “5” –> u“‘5’” list [1,2,3] –> u”[1,2,3]”

Returns:

Dictionary mapping attributes names to values

Return type:

dict[str, str]

GetGeneratorId()

Returns the unique generator id of the referenced parameter generator.

Returns:

generator id

Return type:

str

GetIndex()

Returns the zero based index in the parent.

Returns:

Zero based index

Return type:

int

GetLineNo()

Returns the line number within its project.

Returns:

Line number

Return type:

int

GetName()

Returns the name of the project component.

Returns:

Name of the component

Return type:

str

GetParent()

Returns the parent project component.

Returns:

Parent component

Return type:

ProjectComponent

GetType()
Returns the type (class name) of the project component, e.g.
  • “ConfigChange”

  • “ParameterSet”

  • “PackageCall”

  • “Project”

  • “PackageGenerator”

Returns:

Type (class name) of the project component

Return type:

str

IsEnabled()

Returns the state of the test step.

Returns:

True if test step is enabled, otherwise False

Return type:

bool

IsReported()

Returns whether the test step will be reported. If it has a parent test step, this function will only return true if both this test step and the parent test step should be reported.

Returns:

True if test step will be reported, otherwise False

Return type:

bool

RemoveFromProject()

Removes this component from the project.

Raises:

ApiError – if the component is not part of any project

SetAttribute(attributeName, value)

Sets the value of the attribute of the given name. Value has to be provided as str. Examples:

  • int 5 –> u”5”

  • string “5” –> u“‘5’”

  • list [1,2,3] –> u”[1,2,3]”

Parameters:
attributeName : str

Name of attribute to be returned

value : str

attribute value

SetEnabled(state=True)

Enable or disable the test step.

Parameters:
state : bool

True (=Default) to enable, False to disable the test step.

SetGeneratorAttributes(attributesDict)

Overwrites the existing attributes of the generator with the provided ones. Values have to be provided as str. Examples:

  • int 5 –> u”5”

  • string “5” –> u“‘5’”

  • list [1,2,3] –> u”[1,2,3]”

Parameters:
attributesDict : dict[str, str]

Dictionary mapping attribute names to values

SetName(name)

Sets the name of the project component.

Parameters:
name : str

Name of the component

SetReported(state=True)

Enable or disable the reporting of the test step. If it has a parent test step, its reporting must also be enabled in order to have this test step appear in the report.

Parameters:
state : bool

True (=Default) to enable, False to disable the reporting of the test step.

GetPosition()

Returns the position in the parent project.

Returns:

parent position

Return type:

int

Deprecated since version 2024.4: Please use method GetLineNo instead.