armi.tests.mockRunLogs module

This module contains subclasses of the armi.runLog._RunLog class that can be used to determine whether or not one of the specific methods were called. These should only be used in testing.

class armi.tests.mockRunLogs.BufferLog(*args, **kwargs)[source]

Bases: _RunLog

Log which captures the output in attributes instead of emitting them.

Used mostly in testing to ensure certain things get output, or to prevent any output from showing.

log(msgType, msg, single=False, label=None)[source]

Add formatting to a message and handle its singleness, if applicable.

This is a wrapper around logger.log() that does most of the work and is used by all message passers (e.g. info, warning, etc.).

clearSingleWarnings()[source]

Reset the single warned list so we get messages again.

getStdout()[source]
emptyStdout()[source]
getStderrValue()[source]
class armi.tests.mockRunLogs.LogCounter(*args, **kwargs)[source]

Bases: BufferLog

This mock log is used to count the number of times a method was called.

It can be used in testing to make sure a warning was issued, without checking the content of the message.

log(msgType, *args, **kwargs)[source]