Exemplo n.º 1
0
def test_deserialize_and_serialize_job_config(config_in, config_out,
                                              validation_error):
    schema = JobConfigSchema()
    if validation_error:
        with pytest.raises(ValidationError):
            schema.dump(schema.load(config_in))
    else:
        serialized_from_in = schema.dump(schema.load(config_in))
        serialized_from_out = schema.dump(schema.load(config_out))
        assert serialized_from_in == serialized_from_out
Exemplo n.º 2
0
def test_serialize_and_deserialize_job_config(config):
    schema = JobConfigSchema()
    serialized = schema.dump(config)
    new_config = schema.load(serialized)
    assert new_config == config