def test_06(): """Test codec: decode from dict.""" for dcls in DCLASS_SET: i = factory.get_instance(dcls) j = encoder.as_dict(i) k = encoder.from_dict(j) assert isinstance(k, dcls)
def test_07(): """Test codec: decode from json.""" for dcls in DCLASS_SET: i = factory.get_instance(dcls) j = encoder.as_json(i) k = encoder.from_json(j) assert isinstance(k, dcls)
def _get_test_dclass_instances(): return [factory.get_instance(i) for i in encoder.DCLASS_SET]
def test_04(): """Test codec: encode to dict.""" for i in [factory.get_instance(i) for i in DCLASS_SET]: assert isinstance(encoder.as_dict(i), dict)
def test_05(): """Test codec: encode to json.""" for i in [factory.get_instance(i) for i in DCLASS_SET]: assert isinstance(encoder.as_json(i), bytes)
def test_07(): """Test codec: decode from json.""" for dcls in DCLASS_SET: j = factory.get_instance(dcls).to_json() k = dcls.from_json(j) assert isinstance(k, dcls)
def test_03(): """Test instantiation of test class instances.""" for i in DCLASS_SET: assert factory.get_instance(i) is not None
def test_06(): """Test codec: decode from dict.""" for dcls in DCLASS_SET: j = factory.get_instance(dcls).to_dict() k = dcls.from_dict(j) assert isinstance(k, dcls)
def test_05(): """Test codec: encode to json.""" for i in [factory.get_instance(i) for i in DCLASS_SET]: assert isinstance(i.to_json(), str)
def _get_test_dclass_instances(): return [ factory.get_instance(i) for i in encoder.DCLASS_SET if i not in (RunLock, PhaseLock, StepLock) ]
def _get_test_dclass_instances(): return (factory.get_instance(i) for i in domain.DCLASS_SET)
def test_02(): """Test classes & enums are in typeset.""" for i in [i for i in TYPE_SET if not issubclass(i, enum.Enum)]: assert factory.get_instance(i) is not None