Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
def _get_test_dclass_instances():
    return [factory.get_instance(i) for i in encoder.DCLASS_SET]
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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)
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
def test_03():
    """Test instantiation of test class instances."""
    for i in DCLASS_SET:
        assert factory.get_instance(i) is not None
Ejemplo n.º 8
0
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)
Ejemplo n.º 9
0
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)
Ejemplo n.º 10
0
def _get_test_dclass_instances():
    return [
        factory.get_instance(i) for i in encoder.DCLASS_SET
        if i not in (RunLock, PhaseLock, StepLock)
    ]
Ejemplo n.º 11
0
def _get_test_dclass_instances():
    return (factory.get_instance(i) for i in domain.DCLASS_SET)
Ejemplo n.º 12
0
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