aiida.backends.tests.common package¶
Submodules¶
Tests for the extended dictionary classes.
-
class
aiida.backends.tests.common.test_extendeddicts.
TestAttributeDictAccess
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Try to access the dictionary elements in various ways, copying (shallow and deep), check raised exceptions.
-
__module__
= 'aiida.backends.tests.common.test_extendeddicts'¶
-
-
class
aiida.backends.tests.common.test_extendeddicts.
TestAttributeDictNested
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Test the functionality of nested AttributeDict classes.
-
__module__
= 'aiida.backends.tests.common.test_extendeddicts'¶
-
-
class
aiida.backends.tests.common.test_extendeddicts.
TestAttributeDictSerialize
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Test serialization/deserialization (with json, pickle, …)
-
__module__
= 'aiida.backends.tests.common.test_extendeddicts'¶
-
-
class
aiida.backends.tests.common.test_extendeddicts.
TestDFAD
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Test for the default fields attribute dictionary.
-
__module__
= 'aiida.backends.tests.common.test_extendeddicts'¶
-
-
class
aiida.backends.tests.common.test_extendeddicts.
TestDFADExample
(dictionary=None)[source]¶ Bases:
aiida.common.extendeddicts.DefaultFieldsAttributeDict
An example class that has ‘alpha’, ‘beta’ and ‘gamma’ as default keys.
-
__module__
= 'aiida.backends.tests.common.test_extendeddicts'¶
-
_default_fields
= ('alpha', 'beta', 'gamma')¶
-
-
class
aiida.backends.tests.common.test_extendeddicts.
TestFFAD
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Test for the fixed fields attribute dictionary.
-
__module__
= 'aiida.backends.tests.common.test_extendeddicts'¶
-
-
class
aiida.backends.tests.common.test_extendeddicts.
TestFFADExample
(init=None)[source]¶ Bases:
aiida.common.extendeddicts.FixedFieldsAttributeDict
An example class that accepts only the ‘alpha’, ‘beta’ and ‘gamma’ keys/attributes.
-
__module__
= 'aiida.backends.tests.common.test_extendeddicts'¶
-
_valid_fields
= ('alpha', 'beta', 'gamma')¶
-
Tests for the folder class
-
class
aiida.backends.tests.common.test_folders.
FoldersTest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for the Folder class.
-
__module__
= 'aiida.backends.tests.common.test_folders'¶
-
static
test_create_file_from_filelike_py2
()[source]¶ Test aiida.common.folders.Folder.create_file_from_filelike for python 2.
-
test_create_file_from_filelike_py3
()[source]¶ Test aiida.common.folders.Folder.create_file_from_filelike for python 3.
-
-
aiida.backends.tests.common.test_folders.
fs_encoding_is_utf8
()[source]¶ - Returns
True if the current filesystem encoding is set to UTF-8
Unittests for aiida.common.hashing:make_hash with hardcoded hash values
-
class
aiida.backends.tests.common.test_hashing.
CheckDBRoundTrip
(methodName='runTest')[source]¶ Bases:
aiida.backends.testbase.AiidaTestCase
Check that the hash does not change after a roundtrip via the DB. Note that this class must inherit from AiiDATestCase since it’s working with the DB.
-
__module__
= 'aiida.backends.tests.common.test_hashing'¶
-
-
class
aiida.backends.tests.common.test_hashing.
FloatToTextTest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for the float_to_text methods
-
__module__
= 'aiida.backends.tests.common.test_hashing'¶
-
-
class
aiida.backends.tests.common.test_hashing.
MakeHashTest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for the make_hash function.
-
__module__
= 'aiida.backends.tests.common.test_hashing'¶
-
Tests for the lang
module.
-
class
aiida.backends.tests.common.test_lang.
Protected
[source]¶ Bases:
object
Class to test the protected decorator.
-
__dict__
= mappingproxy({'__module__': 'aiida.backends.tests.common.test_lang', '__doc__': 'Class to test the protected decorator.', 'member_internal': <function Protected.member_internal>, 'member_unprotected': <function Protected.member_unprotected>, 'member_protected_unchecked': <function Protected.member_protected_unchecked>, 'member_protected_checked': <function Protected.member_protected_checked>, 'property_correct_order': <property object>, '__dict__': <attribute '__dict__' of 'Protected' objects>, '__weakref__': <attribute '__weakref__' of 'Protected' objects>})¶
-
__module__
= 'aiida.backends.tests.common.test_lang'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
member_protected_checked
()[source]¶ Decorated method but without check - cannot be called outside scope.
-
member_protected_unchecked
()[source]¶ Decorated method but without check - can be called outside scope.
-
property
property_correct_order
¶ Decorated property but without check - cannot be called outside scope.
-
-
class
aiida.backends.tests.common.test_lang.
TestProtectedDecorator
(methodName='runTest')[source]¶ Bases:
aiida.backends.testbase.AiidaTestCase
Tests for the
protected()
decorator.-
__module__
= 'aiida.backends.tests.common.test_lang'¶
-
test_property_incorrect_order
()[source]¶ The protected decorator should raise if applied before the property decorator.
-
test_protected_property_correct_order
()[source]¶ Test that calling a checked protected property raises.
-
Tests for the links utilities.
-
class
aiida.backends.tests.common.test_links.
TestValidateLinkLabel
(methodName='runTest')[source]¶ Bases:
aiida.backends.testbase.AiidaTestCase
Tests for validate_link_label function.
-
__module__
= 'aiida.backends.tests.common.test_links'¶
-
Tests for the logging module.
-
class
aiida.backends.tests.common.test_logging.
TestLogger
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Test global python logging module.
-
__module__
= 'aiida.backends.tests.common.test_logging'¶
-
Serialization tests
-
class
aiida.backends.tests.common.test_serialize.
TestSerialize
(methodName='runTest')[source]¶ Bases:
aiida.backends.testbase.AiidaTestCase
Tests for the YAML serializer and deserializer.
-
__module__
= 'aiida.backends.tests.common.test_serialize'¶
-
test_mixed_attribute_normal_dict
()[source]¶ Regression test for #3092.
The yaml mapping constructor in aiida.orm.utils.serialize was not properly “deeply” reconstructing nested mappings, causing a mix of attribute dictionaries and normal dictionaries to lose information in a round-trip.
If a nested AttributeDict contained a normal dictionary, the content of the latter would be lost during the deserialization, despite the information being present in the serialized yaml dump.
-
test_serialize_group
()[source]¶ Test that serialization and deserialization of Groups works. Also make sure that the serialized data is json-serializable
-
Tests for the timezone utility module.
-
class
aiida.backends.tests.common.test_timezone.
TimezoneTest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for the timezone utility module.
-
__module__
= 'aiida.backends.tests.common.test_timezone'¶
-
Tests for the aiida.common.utils functionality
-
class
aiida.backends.tests.common.test_utils.
PrettifierTest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for the Prettifier class methods.
-
__module__
= 'aiida.backends.tests.common.test_utils'¶
-
-
class
aiida.backends.tests.common.test_utils.
SqlStringMatchTest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
” Test the functions to convert SQL to regex patterns
-
__module__
= 'aiida.backends.tests.common.test_utils'¶
-
-
class
aiida.backends.tests.common.test_utils.
UniqueTest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for the get_unique_filename function.
-
__module__
= 'aiida.backends.tests.common.test_utils'¶
-
seq
= -1¶
-
test_ask_backup_question
()[source]¶ This method checks that the combined use of query_string and query_yes_no by the ask_backup_question is done as expected.
-