MCPcopy Create free account
hub / github.com/apache/fory / test_scalar_tracking_ref_rules

Function test_scalar_tracking_ref_rules

python/pyfory/tests/test_struct.py:493–523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

491
492
493def test_scalar_tracking_ref_rules():
494 with pytest.raises(TypeNotCompatibleError):
495 compat_ser_de(RemoteRefBoolScalar, LocalBoolScalar, RemoteRefBoolScalar(True), 739, ref=True)
496 with pytest.raises(TypeNotCompatibleError):
497 compat_ser_de(RemoteBoolScalar, LocalRefBoolScalar, RemoteBoolScalar(True), 740, ref=True)
498 assert compat_ser_de(RemoteRefBoolScalar, LocalRefBoolScalar, RemoteRefBoolScalar(True), 741, ref=True) == LocalRefBoolScalar(True)
499 with pytest.raises(TypeNotCompatibleError):
500 compat_ser_de(RemoteRefFixedInt32Scalar, LocalRefInt32Scalar, RemoteRefFixedInt32Scalar(7), 742, ref=True)
501 with pytest.raises(TypeNotCompatibleError):
502 compat_ser_de(
503 RemoteOptionalRefBoolScalar,
504 LocalRefBoolScalar,
505 RemoteOptionalRefBoolScalar(True),
506 748,
507 ref=True,
508 )
509 with pytest.raises(TypeNotCompatibleError):
510 compat_ser_de(
511 RemoteRefBoolScalar,
512 LocalOptionalRefBoolScalar,
513 RemoteRefBoolScalar(True),
514 749,
515 ref=True,
516 )
517 assert compat_ser_de(
518 RemoteOptionalRefBoolScalar,
519 LocalOptionalRefBoolScalar,
520 RemoteOptionalRefBoolScalar(True),
521 750,
522 ref=True,
523 ) == LocalOptionalRefBoolScalar(True)
524
525
526def test_same_schema_scalar_read_is_direct():

Callers

nothing calls this directly

Calls 7

compat_ser_deFunction · 0.85
RemoteRefBoolScalarClass · 0.85
RemoteBoolScalarClass · 0.85
LocalRefBoolScalarClass · 0.85

Tested by

no test coverage detected