pyfmu.tests.example_finder

Module Contents

pyfmu.tests.example_finder._ssp_examples = ['SumOfSines']
pyfmu.tests.example_finder._correct_example
pyfmu.tests.example_finder._incorrect_examples
pyfmu.tests.example_finder.get_example_directory() → Path

Returns the path to the example projects

pyfmu.tests.example_finder.get_incorrect_examples()

Returns the set of examples that are expected to fail

Returns:

[Set] – The set of all examples which are designed to cause faults.

pyfmu.tests.example_finder.get_correct_examples()

Returns the set of examples that are expected to work correctly.

Returns:

[Set] – The set of all examples which should function correctly.

pyfmu.tests.example_finder.get_all_examples()

Returns the set of all available examples including the ones that are expected to fail.

Returns:

[Set] – The set of all available examples

pyfmu.tests.example_finder.get_system_example(name: str) → Path

Returns the path to the specified SSP example.

Arguments:

name {str} – name of the example zipped {bool} – returns path to zipped archive

Returns:

Path – path to the example

pyfmu.tests.example_finder.get_example_project(name: str) → Path

Gets the path to a specific example project.

pyfmu.tests.example_finder.get_exported_example_project(name: str)

Gets the path to a specific example project, to get an fmu use get_example_fmu(…)

class pyfmu.tests.example_finder.ExampleProject(project_name: str)

Wrapper that encapsulates the creation of example projects used for automatic testing.

Wrapper that encapsulates the exporting of example archives used for automatic testing.

This allows them to be accessed using a with statements. Attributes such as the path to the object can be accessed through the archive object which is returned. ``` with ExampleProject(‘Adder’) as p:

print(p.modelDescription) …

```

The example project generated as a copy of an example project inside a temporary folder, which is freed after the with statement terminates. Modifications of properties such as its model description can be made through its properties: ``` with ExampleProject(‘Adder’) as p:

p.modelDescription = “invalid model description” …

```

__enter__(self)
__exit__(self, exception_type, exception_value, traceback)
class pyfmu.tests.example_finder.ExampleArchive(project_name: str)

Wrapper that encapsulates the exporting of example archives used for automatic testing.

This allows them to be accessed using a with statements. Attributes such as the path to the object can be accessed through the archive object which is returned. ``` with ExampleArchive(‘Adder’) as p:

print(p.modelDescription) …

```

The example project is exported as an FMU to a temporary folder, which is automatically freed after the with statement terminates.

__enter__(self)
__exit__(self, exception_type, exception_value, traceback)
class pyfmu.tests.example_finder.ExampleSystem(name, zipped=True)

Context manager for exporting example SSP projects for testing.

__enter__(self)
__exit__(self, exception_type, exception_value, traceback)