armi.tests.test_user_plugins module

Tests for the UserPlugin class.

class armi.tests.test_user_plugins.UserPluginFlags(*args, **kwargs)[source]

Bases: UserPlugin

Simple UserPlugin that defines a single, new flag.

static defineFlags()[source]

Function to provide new Flags definitions.

class armi.tests.test_user_plugins.UserPluginFlags2(*args, **kwargs)[source]

Bases: UserPlugin

Simple UserPlugin that defines a single, new flag.

static defineFlags()[source]

Function to provide new Flags definitions.

class armi.tests.test_user_plugins.UserPluginFlags3(*args, **kwargs)[source]

Bases: UserPlugin

Simple UserPlugin that defines a single, new flag.

static defineFlags()[source]

Function to provide new Flags definitions.

class armi.tests.test_user_plugins.UserPluginBadDefinesSettings(*args, **kwargs)[source]

Bases: UserPlugin

This is invalid/bad because it implements defineSettings().

static defineSettings()[source]

Define settings for the plugin.

class armi.tests.test_user_plugins.UserPluginBadDefineParameterRenames(*args, **kwargs)[source]

Bases: UserPlugin

This is invalid/bad because it implements defineParameterRenames().

static defineParameterRenames()[source]

Return a mapping from old parameter names to new parameter names.

class armi.tests.test_user_plugins.UserPluginOnProcessCoreLoading(*args, **kwargs)[source]

Bases: UserPlugin

This plugin flex-tests the onProcessCoreLoading() hook, and arbitrarily adds “1” to the height of every block, after the DB is loaded.

static onProcessCoreLoading(core, cs, dbLoad)[source]

Function to call whenever a Core object is newly built.

class armi.tests.test_user_plugins.UpInterface(r, cs)[source]

Bases: Interface

A mostly meaningless little test interface, just to prove that we can affect the reactor state from an interface inside a UserPlugin.

Construct an interface.

The r and cs arguments are required, but may be None, where appropriate for the specific Interface implementation.

Parameters:
  • r (Reactor) – A reactor to attach to

  • cs (Settings) – Settings object to use

Raises:

RuntimeError – Interfaces derived from Interface must define their name

name: Optional[str] = 'UpInterface'

The name of the interface. This is undefined for the base class, and must be overridden by any concrete class that extends this one.

interactEveryNode(cycle, node)[source]

Logic to be carried out at every time node in the simulation.

class armi.tests.test_user_plugins.UserPluginWithInterface(*args, **kwargs)[source]

Bases: UserPlugin

A little test UserPlugin, just to show how to add an Interface through a UserPlugin.

static exposeInterfaces(cs)[source]

Function for exposing interface(s) to other code.

class armi.tests.test_user_plugins.TestUserPlugins(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_userPluginsFlags()[source]
test_validateUserPluginLimitations()[source]
test_registerUserPlugins()[source]
test_registerUserPluginsAbsPath()[source]
test_registerUserPluginsFromSettings()[source]
test_userPluginOnProcessCoreLoading()[source]

Test that a UserPlugin can affect the Reactor state, by implementing onProcessCoreLoading() to arbitrarily increase the height of all the blocks by 1.0.

test_userPluginWithInterfaces()[source]

Test that UserPlugins can correctly inject an interface into the stack.

test_registerRepeatedUserPlugins()[source]