armi.reactor.tests.test_parameters module

Tests for assorted Parameters tools.

class armi.reactor.tests.test_parameters.MockComposite(name)[source]

Bases: object

class armi.reactor.tests.test_parameters.MockCompositeGrandParent(name)[source]

Bases: MockComposite

class armi.reactor.tests.test_parameters.MockCompositeParent(name)[source]

Bases: MockCompositeGrandParent

class armi.reactor.tests.test_parameters.MockCompositeChild(name)[source]

Bases: MockCompositeParent

class armi.reactor.tests.test_parameters.ParameterTests(methodName='runTest')[source]

Bases: TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_mutableDefaultsNotSupported()[source]
test_writeSomeParamsToDB()[source]

This tests the ability to specify which parameters should be written to the database. It assumes that the list returned by ParameterDefinitionCollection.toWriteToDB() is used to filter for which parameters to include in the database.

Test Case: Restrict parameters from DB write. T_ARMI_PARAM_DB
signature: test_writeSomeParamsToDB
requirements: R_ARMI_PARAM_DB
Test Case: Ensure that new parameters can be defined. T_ARMI_PARAM0
signature: test_writeSomeParamsToDB
requirements: R_ARMI_PARAM
test_serializer_pack_unpack()[source]

This tests the ability to add a serializer to a parameter instantiation line. It assumes that if this parameter is not None, that the pack and unpack methods will be called during storage to and reading from the database. See database._writeParams for an example use of this functionality.

Test Case: Custom parameter serializer T_ARMI_PARAM_SERIALIZE
signature: test_serializer_pack_unpack
test_paramPropertyDoesNotConflict()[source]
test_paramPropertyDoesNotConflictWithNoneDefault()[source]
test_getWithoutDefaultRaisesParameterError()[source]
test_attemptingToSetParamWithoutSetterFails()[source]
test_setter()[source]

Test the Parameter setter() tooling, that signifies if a Parameter has been updated.

Test Case: Tooling that allows a Parameter to signal it needs to be updated across processes. T_ARMI_PARAM_PARALLEL0
signature: test_setter
requirements: R_ARMI_PARAM_PARALLEL
test_setterGetterBasics()[source]

Test the Parameter setter/getter tooling, through the lifecycle of a Parameter being updated.

Test Case: Tooling that allows a Parameter to signal it needs to be updated across processes. T_ARMI_PARAM_PARALLEL1
signature: test_setterGetterBasics
requirements: R_ARMI_PARAM_PARALLEL
test_cannotDefineParameterWithSameName()[source]
test_paramDefinitionsCompose()[source]
test_cannotDefineParamSameNameCollectionSubclass()[source]
test_cannotCreateAttrbuteOnParameterCollectionSubclass()[source]
test_cannotCreateInstanceOf_NoDefault()[source]
test_cannotCreateInstanceOf_Undefined()[source]
test_defaultLocation()[source]
test_categories()[source]
test_parameterCollectionsHave__slots__()[source]

Tests we prevent accidental creation of attributes.

class armi.reactor.tests.test_parameters.ParamCollectionWhere(methodName='runTest')[source]

Bases: TestCase

Tests for ParameterCollection.where.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class ScopeParamCollection(_state: List[Any] | None = None)[source]

Bases: ParameterCollection

Create a new ParameterCollection instance.

Parameters:

_state – Optional list of parameter values, ordered by _allFields. Passed values should come from a call to __getstate__(). This should only be used internally to this model.

pDefs: parameterDefinitions.ParameterDefinitionCollection = <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>
pb = <armi.reactor.parameters.parameterDefinitions.ParameterBuilder object>
test_onCategory()[source]

Test the use of Parameter.hasCategory on filtering.

test_onLocation()[source]

Test the use of Parameter.atLocation in filtering.

test_complicated()[source]

Test a multi-condition filter.

class armi.reactor.tests.test_parameters.TestMakeParametersReadOnly(methodName='runTest')[source]

Bases: TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_makeParametersReadOnly()[source]