Exemple #1
0
def test_meta_transaction_roundtrip(meta_transaction):
    dumped = schemas.MetaTransactionSchema().dump(meta_transaction)
    print("DUMPED", dumped)

    loaded = schemas.MetaTransactionSchema().load(dumped)
    print("LOADED", loaded)

    assert loaded == meta_transaction
Exemple #2
0
def test_load_meta_transaction_valid_values(values):
    dumped = schemas.MetaTransactionSchema().dump(a_valid_meta_transaction)
    dumped.update(values)
    # If the load fails, a `<marshmallow.exceptions.ValidationError>` is raised
    schemas.MetaTransactionSchema().load(dumped)
Exemple #3
0
def test_load_meta_transaction_invalid_values(values):
    dumped = schemas.MetaTransactionSchema().dump(a_valid_meta_transaction)
    dumped.update(values)
    with pytest.raises(ValidationError):
        schemas.MetaTransactionSchema().load(dumped)