def setUpClass(cls): cls.loader_old = capnp.SchemaLoader() cls.loader_old.load_once(cls.compile('test-compatibility-old.capnp')) cls.loader_new = capnp.SchemaLoader() cls.loader_new.load_once(cls.compile('test-compatibility-new.capnp')) name = 'unittest.test_compatibility:TestStruct' cls.schema_old = cls.loader_old.struct_schemas[name] cls.converter_old = objects.DataclassConverter(cls.schema_old, TestStructOld) cls.schema_new = cls.loader_new.struct_schemas[name] cls.converter_new = objects.DataclassConverter(cls.schema_new, TestStructNew)
def setUpClass(cls): cls.loader = capnp.SchemaLoader() cls.loader.load_once(cls.compile('test-1.capnp')) cls.schema = cls.loader.struct_schemas[ 'g1.messaging.tests.test_1:SomeStruct'] cls.wire_data = capnps.CapnpWireData(cls.loader) cls.packed_wire_data = capnps.CapnpPackedWireData(cls.loader)
__all__ = [ 'LOADER', 'PACKED_WIRE_DATA', 'WIRE_DATA', ] from pathlib import Path import capnp from g1.messaging.wiredata import capnps from . import interfaces LOADER = capnp.SchemaLoader() LOADER.load_once((Path(__file__).parent / 'databases.schema').read_bytes()) WIRE_DATA = capnps.CapnpWireData(LOADER) WIRE_DATA.register(interfaces.DatabaseRequest) WIRE_DATA.register(interfaces.DatabaseResponse) WIRE_DATA.register(interfaces.DatabaseEvent) PACKED_WIRE_DATA = capnps.CapnpPackedWireData(LOADER) PACKED_WIRE_DATA.register(interfaces.DatabaseRequest) PACKED_WIRE_DATA.register(interfaces.DatabaseResponse) PACKED_WIRE_DATA.register(interfaces.DatabaseEvent)
def setUpClass(cls): cls.loader = capnp.SchemaLoader() cls.loader.load_once(cls.compile('test-2.capnp')) cls.wire_data = capnps.CapnpWireData(cls.loader)
def setUpClass(cls): cls.loader = capnp.SchemaLoader() cls.loader.load_once(cls.compile('test-2.capnp'))