def test_create_test_object(self): obj = create_test_object(Atom('abc'), 'testing abc', 123) self.assertEqual(obj._test_msg, 'testing abc') self.assertEqual(obj._test_val, 123)
PowerSet, Structure, Union from algebraixlib.util.test import create_test_object _print_examples = False def _print_object_collection(name): if _print_examples: print('{name}:'.format(name=name)) for key, val in sorted(globals()[name].items()): print(' "{key}": {val}'.format(key=key, val=val)) #: Two 'instances' of Structure. (They should be the same.) empties = { key: create_test_object(Structure(), key, val) for key, val in { '{}': None, '{}-2': None }.items() } _print_object_collection('empties') #: Two 'instances' of GenesisSetA. (They should be the same.) setas = { key: create_test_object(GenesisSetA(), key, val) for key, val in { 'A': None, 'A-2': None }.items() }
# -------------------------------------------------------------------------------------------------- from algebraixlib.structure import CartesianProduct, GenesisSetA, GenesisSetM, GenesisSetN, PowerSet, Structure, Union from algebraixlib.util.test import create_test_object _print_examples = False def _print_object_collection(name): if _print_examples: print("{name}:".format(name=name)) for key, val in sorted(globals()[name].items()): print(' "{key}": {val}'.format(key=key, val=val)) #: Two 'instances' of Structure. (They should be the same.) empties = {key: create_test_object(Structure(), key, val) for key, val in {"{}": None, "{}-2": None}.items()} _print_object_collection("empties") #: Two 'instances' of GenesisSetA. (They should be the same.) setas = {key: create_test_object(GenesisSetA(), key, val) for key, val in {"A": None, "A-2": None}.items()} _print_object_collection("setas") #: Two 'instances' of GenesisSetM. (They should be the same.) setms = {key: create_test_object(GenesisSetM(), key, val) for key, val in {"M": None, "M-2": None}.items()} _print_object_collection("setms") setns = {key: create_test_object(GenesisSetN(), key, val) for key, val in {"N": None, "N-2": None}.items()} _print_object_collection("setns")
from algebraixlib.structure import CartesianProduct, GenesisSetA, GenesisSetM, GenesisSetN, \ PowerSet, Structure, Union from algebraixlib.util.test import create_test_object _print_examples = False def _print_object_collection(name): if _print_examples: print('{name}:'.format(name=name)) for key, val in sorted(globals()[name].items()): print(' "{key}": {val}'.format(key=key, val=val)) #: Two 'instances' of Structure. (They should be the same.) empties = {key: create_test_object(Structure(), key, val) for key, val in { '{}': None, '{}-2': None }.items()} _print_object_collection('empties') #: Two 'instances' of GenesisSetA. (They should be the same.) setas = {key: create_test_object(GenesisSetA(), key, val) for key, val in { 'A': None, 'A-2': None }.items()} _print_object_collection('setas') #: Two 'instances' of GenesisSetM. (They should be the same.)