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_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_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_setterGetterBasics()[source]

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

test_cannotDefineParameterWithSameName()[source]
test_paramDefinitionsCompose()[source]
test_cannotDefineParameterWithSameNameForCollectionSubclass()[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: Optional[List[Any]] = 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: 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]