OpenAssetIO
An abstract API for generalising interactions between a host application and an asset management system
|
The API distribution includes a test harness that can be used to test the implementation of any given Manager Plugin. It is a unittest
based framework that can be used stand-alone via the command line, or extended with additional test suites for extra coverage.
The harness acts as an OpenAssetIO host. Two things are needed to test any given codebase:
OpenAssetIO only defines a set of methods that a host can use to communicate with a manager. It does not dictate the specifics of what constitutes valid inputs, or output from any given manager. This is specific to its data model and implementation.
Consequently the test harness needs to be supplied with valid values to pass to methods such as isEntityReferenceString, and the expected values from methods such as identifier
The file should set a top level variable called fixtures
, holding a dict structured as-per the fixtures
parameter documented here. For example:
fixtures.py
).The simplest way to test a Manager Plugin is via the command line:
If desired, additional arguments can be passed to the unittest
framework as if the module was being used directly. The following, for example, enables verbose mode:
The CLI will run the standard API compliance suite. This checks that the plugin's implementation returns the expected types and handles invalid input appropriately.
To run additional test suites, to validate manager-specific business logic, the CLI entry point can be trivially recreated in python by calling the harness API directly:
Copyright 2013-2023 The Foundry Visionmongers Ltd. OpenAssetIO is released under the Apache 2.0 License