armi.tests.test_user_plugins module

Tests for the UserPlugin class.

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

Bases: armi.plugins.UserPlugin

Simple UserPlugin that defines a single, new flag.

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

Bases: armi.plugins.UserPlugin

Simple UserPlugin that defines a single, new flag.

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

Bases: armi.plugins.UserPlugin

Simple UserPlugin that defines a single, new flag.

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

Bases: armi.plugins.UserPlugin

This is invalid/bad because it implements defineSettings()

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

Bases: armi.plugins.UserPlugin

This is invalid/bad because it implements defineParameterRenames()

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

Bases: armi.plugins.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]
class armi.tests.test_user_plugins.UpInterface(r, cs)[source]

Bases: armi.interfaces.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]
class armi.tests.test_user_plugins.UserPluginWithInterface(*args, **kwargs)[source]

Bases: armi.plugins.UserPlugin

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

static exposeInterfaces(cs)[source]
class armi.tests.test_user_plugins.TestUserPlugins(methodName='runTest')[source]

Bases: unittest.case.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