armi.bookkeeping.db.tests.test_database3 module

Tests for the Database class.

class armi.bookkeeping.db.tests.test_database3.TestDatabase(methodName='runTest')[source]

Bases: TestCase

Tests for the Database class that require a large, complicated reactor.

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.

makeShuffleHistory()[source]

Walk the reactor through a few time steps with some shuffling.

test_load()[source]

Load a reactor at different time steps, from the database.

Test Case: Load the reactor from the database. T_ARMI_DB_TIME1
signature: test_load
requirements: R_ARMI_DB_TIME
test_loadSortSetting()[source]
test_history()[source]
class armi.bookkeeping.db.tests.test_database3.TestDatabaseSmaller(methodName='runTest')[source]

Bases: TestCase

Tests for the Database class, that can use a smaller test reactor.

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.

makeHistory()[source]

Walk the reactor through a few time steps and write them to the db.

test_loadOperator()[source]
test_getArrayShape()[source]

Tests a helper method for _writeParams.

test_writeToDB()[source]

Test writing to the database.

Test Case: Write a single time step of data to the database. T_ARMI_DB_TIME0
signature: test_writeToDB
requirements: R_ARMI_DB_TIME
test_getH5File()[source]

Get the h5 file for the database, because that file format is language-agnostic.

Test Case: Show the database is H5-formatted. T_ARMI_DB_H5
signature: test_getH5File
requirements: R_ARMI_DB_H5
test_auxData()[source]
test_replaceNones()[source]

Super basic test that we handle Nones correctly in database read/writes.

test_mergeHistory()[source]
test_splitDatabase()[source]
test_grabLocalCommitHash()[source]

Test of static method to grab a local commit hash with ARMI version.

test_fileName()[source]
test_readInputsFromDB()[source]

Test that we can read inputs from the database.

Test Case: Save and retrieve settings from the database. T_ARMI_DB_CS
signature: test_readInputsFromDB
requirements: R_ARMI_DB_CS
Test Case: Save and retrieve blueprints from the database. T_ARMI_DB_BP
signature: test_readInputsFromDB
requirements: R_ARMI_DB_BP
test_deleting()[source]
test_open()[source]
test_loadCS()[source]
test_loadBlueprints()[source]
test_prepRestartRun()[source]

This test is based on the armiRun.yaml case that is loaded during the setUp above. In that cs, reloadDBName is set to ‘reloadingDB.h5’, startCycle = 1, and startNode = 2. The nonexistent ‘reloadingDB.h5’ must first be created here for this test.

Test Case: Runs can be restarted from a snapshot. T_ARMI_SNAPSHOT_RESTART
signature: test_prepRestartRun
test_computeParents()[source]
class armi.bookkeeping.db.tests.test_database3.TestWriteReadDatabase(methodName='runTest')[source]

Bases: TestCase

Round-trip tests that we can write/read data to and from a Database.

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.

SMALL_YAML = '!include refOneBlockReactor.yaml\nsystems:\n    core:\n        grid name: core\n        origin:\n            x: 0.0\n            y: 0.0\n            z: 0.0\n    sfp:\n        type: sfp\n        grid name: sfp\n        origin:\n            x: 1000.0\n            y: 1000.0\n            z: 1000.0\n    evst:\n        type: excore\n        grid name: evst\n        origin:\n            x: 2000.0\n            y: 2000.0\n            z: 2000.0\ngrids:\n    core:\n      geom: hex_corners_up\n      lattice map: |\n        IC\n      symmetry: full\n    evst:\n      lattice pitch:\n          x: 32.0\n          y: 32.0\n      geom: hex\n      symmetry: full\n'
test_readWriteRoundTrip()[source]

Test DB some round tripping, writing some data to a DB, then reading from it.

In particular, we test some parameters on the reactor, core, and blocks. And we move an assembly from the core to an EVST between timenodes, and test that worked.

test_badData()[source]