aiida.backends.tests.orm.utils package

Submodules

Tests for the CalcJob utils.

class aiida.backends.tests.orm.utils.test_calcjob.TestCalcJobResultManager(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

Tests for the CalcJobResultManager utility class.

__module__ = 'aiida.backends.tests.orm.utils.test_calcjob'
classmethod setUpClass(*args, **kwargs)[source]

Define a useful CalcJobNode to test the CalcJobResultManager.

We emulate a node for the TemplateReplacer calculation job class. To do this we have to make sure the process type is set correctly and an output parameter node is created.

test_getattr()[source]

Test that the manager support getattr operator.

test_getitem()[source]

Test that the manager support getitem operator.

test_invalid_process_type()[source]

get_results should raise ValueError if CalcJobNode has invalid process_type

test_iterator()[source]

Test that the manager can be iterated over.

test_no_process_type()[source]

get_results should raise ValueError if CalcJobNode has no process_type

test_process_class_no_default_node()[source]

get_results should raise ValueError if process class does not define default output node.

class aiida.backends.tests.orm.utils.test_loaders.TestOrmUtils(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

__module__ = 'aiida.backends.tests.orm.utils.test_loaders'
test_load_code()[source]

Test the functionality of load_code.

test_load_computer()[source]

Test the functionality of load_group.

test_load_entiy()[source]

Test the functionality of load_entity which is the base function for the other loader functions.

test_load_group()[source]

Test the functionality of load_group.

test_load_node()[source]

Test the functionality of load_node.

Tests for the Node utils.

class aiida.backends.tests.orm.utils.test_node.TestLoadNodeClass(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

Tests for the node plugin type generator and loaders.

__module__ = 'aiida.backends.tests.orm.utils.test_node'
test_load_node_class_fallback()[source]

Verify that load_node_class will fall back to Data class if entry point cannot be loaded.

Tests for the Repository utility class.

class aiida.backends.tests.orm.utils.test_repository.TestRepository(methodName='runTest')[source]

Bases: aiida.backends.testbase.AiidaTestCase

Tests for the node Repository utility class.

__module__ = 'aiida.backends.tests.orm.utils.test_repository'
create_file_tree(directory, tree)[source]

Create a file tree in the given directory.

Parameters:
  • directory – the absolute path of the directory into which to create the tree
  • tree – a dictionary representing the tree structure
get_file_content(key)[source]

Get the content of a file for a given key.

Parameters:key – the nested key of the file to retrieve
Returns:the content of the file
setUp()[source]

Create a dummy file tree.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_put_object_from_file()[source]

Test the put_object_from_file method.

test_put_object_from_filelike()[source]

Test the put_object_from_filelike method.

test_put_object_from_tree()[source]

Test the put_object_from_tree method.