def test_serialization_sanity():
    assert (int(sealapi.COMPR_MODE_TYPE.NONE) == 0)
    assert (int(sealapi.COMPR_MODE_TYPE.ZLIB) == 1)
    assert (int(sealapi.COMPR_MODE_TYPE.ZSTD) == 2)
    header = sealapi.Serialization.SEALHeader()
    assert (header.magic == 41310)
    assert (header.header_size == 16)
    assert (header.version_major == 3)
    assert (header.version_minor == 6)
    assert (header.compr_mode == sealapi.COMPR_MODE_TYPE.NONE)
    assert (header.size == 0)
    assert (header.reserved == 0)
    assert (sealapi.Serialization.IsSupportedComprMode(15) is False)
    header = sealapi.Serialization.SEALHeader()
    assert (sealapi.Serialization.IsValidHeader(header) is True)
    header = sealapi.Serialization.SEALHeader()
    header.compr_mode = sealapi.COMPR_MODE_TYPE.ZLIB

    def save_load(path):
        sealapi.Serialization.SaveHeader(header, path)
        save_test = sealapi.Serialization.SEALHeader()
        sealapi.Serialization.LoadHeader(path, save_test, True)
        assert (save_test.compr_mode == sealapi.COMPR_MODE_TYPE.ZLIB)
        sealapi.Serialization.LoadHeader(path, save_test, False)
        assert (save_test.compr_mode == sealapi.COMPR_MODE_TYPE.ZLIB)
    tmp_file(save_load)
def test_serialization_sanity():
    assert (int(sealapi.COMPR_MODE_TYPE.NONE) == 0)
    assert (int(sealapi.COMPR_MODE_TYPE.ZLIB) == 1)
    assert (int(sealapi.COMPR_MODE_TYPE.ZSTD) == 2)
    header = sealapi.Serialization.SEALHeader()
    assert (header.magic == 41310)
    assert (header.header_size == 16)
    assert (header.version_major == 3)
    assert (header.version_minor == 6)
    assert (header.compr_mode == sealapi.COMPR_MODE_TYPE.NONE)
    assert (header.size == 0)
    assert (header.reserved == 0)
    assert (sealapi.Serialization.IsSupportedComprMode(15) is False)
    header = sealapi.Serialization.SEALHeader()
    assert (sealapi.Serialization.IsValidHeader(header) is True)
    header = sealapi.Serialization.SEALHeader()
    header.compr_mode = sealapi.COMPR_MODE_TYPE.ZLIB

    def save_load(path):
        sealapi.Serialization.SaveHeader(header, path)
        save_test = sealapi.Serialization.SEALHeader()
        sealapi.Serialization.LoadHeader(path, save_test, True)
        assert (save_test.compr_mode == sealapi.COMPR_MODE_TYPE.ZLIB)
        sealapi.Serialization.LoadHeader(path, save_test, False)
        assert (save_test.compr_mode == sealapi.COMPR_MODE_TYPE.ZLIB)
    tmp_file(save_load)