Exemple #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)
Exemple #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)
Exemple #3
0
def _get_test_dclass_instances():
    return [factory.get_instance(i) for i in encoder.DCLASS_SET]
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #7
0
def test_03():
    """Test instantiation of test class instances."""
    for i in DCLASS_SET:
        assert factory.get_instance(i) is not None
Exemple #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)
Exemple #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)
Exemple #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)
    ]
def _get_test_dclass_instances():
    return (factory.get_instance(i) for i in domain.DCLASS_SET)
Exemple #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