ToolHost

class ToolHost
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:

ToolHost

CreateTool(toolName, useLegacyName=True)

Creates and configures a tool to be used by the corresponding test bench configuration.

Parameters:
toolName : str

The name of the tool to use. Use GetAvailableToolNames() to get a list of all available tool names.

useLegacyName : bool

Prefer short legacy/internal name for the tool instead of combination of vendor and tool name

Returns:

The created tool object

Return type:

Tool

Raises:

ApiError – If tool could not be created

GetAvailableToolNames(getLegacyNames=False)

Returns a list of all tools that are available on this tool host.

Parameters:
getLegacyNames : bool

Get short legacy/internal names for the tool instead of combination of vendor and tool name

Returns:

The list of available tools

Return type:

list[str]

GetBasePath()

Returns the tool host base path that is used for several tool property settings.

Returns:

The tool host base path

Return type:

str

GetTools()

Returns all tools used by this tool host.

Returns:

A list of the used tools.

Return type:

list[Tool]

GetUrl()

Returns the tool host URL.

Returns:

The URL

Return type:

str

InsertTool(tool)

Adds a copy of the given tool to the toolhost. If the tool ID (alias) is already present in the destination test bench configuration, a new ID will automatically be assigned. The same applies to port IDs that are already taken. If a port of the given tool can’t be copied, it will be omitted.

Parameters:
tool

Tool to be copied

Returns:

Tool that was copied to the toolhost

Return type:

Tool

Raises:

ApiError – If tool could not be inserted

Refresh()

Refreshes the tool and all its ports

RemoveTool(tool)

Removes the tool and all configured ports from the tool host.

Parameters:
tool

The tool to be removed

Rename(newUrl)

Sets the URL of a given tool host. E.g.:

  • ‘local’

  • ‘tsp:127.0.0.1:5017’

  • ‘tsp:hostname:5017’

Parameters:
newUrl : str

New URL

SetBasePath(basePath)

Sets the tool host base path. A value of ‘<workspace>’ represents the current workspace path and can be combined with sub-paths (e.g., ‘<workspace>/Models’).

Parameters:
basePath : str

Base path on the tool host

AddTool(toolName, useLegacyName=True)

Configures a tool to be used by the corresponding test bench configuration.

Parameters:
toolName : str

The name of the tool to use. Use GetAvailableToolNames() to get a list of all available tool names.

useLegacyName : bool

Prefer short legacy/internal name for the tool instead of combination of vendor and tool name

Returns:

The created tool object

Return type:

Tool

Deprecated since version 2025.2: Please use method CreateTool instead.

GetToolAccessTimeout()

Returns the minimum of timeouts for all tool calls.

Returns:

timeout in seconds

Return type:

int

Deprecated since version 2024.2: Tool access timeout can now be accessed as a property on the tool.

SetToolAccessTimeout(timeout)

Sets the timeout for tool calls. After that time, a tool call will be terminated with an error.

Parameters:
timeout : int

timeout in seconds

Deprecated since version 2024.2: Tool access timeout can now be accessed as a property on the tool.