예제 #1
0
def test_header_extended_user_type_fields_list():
    bs = pack("uintbe:32, bytes:4, uintbe:64, bytes:16", 1, b"uuid",
              MAX_UINT_32 + 1, b":benzina\x00\x00\x00\x00\x00\x00\x00\x00")

    fields_list = flists.BoxHeaderFieldsList()
    fields_list.box_size = 1
    fields_list.box_type = b"uuid"
    fields_list.box_ext_size = MAX_UINT_32 + 1
    fields_list.user_type = b":benzina\x00\x00\x00\x00\x00\x00\x00\x00"

    assert fields_list.box_size == 1
    assert fields_list.box_type == b"uuid"
    assert fields_list.box_ext_size == MAX_UINT_32 + 1
    assert fields_list.user_type == b":benzina\x00\x00\x00\x00\x00\x00\x00\x00"
    assert bytes(fields_list) == bs.bytes

    fields_list = flists.BoxHeaderFieldsList()
    fields_list.box_ext_size = MAX_UINT_32 + 1
    fields_list.user_type = b":benzina\x00\x00\x00\x00\x00\x00\x00\x00"
    fields_list.box_type = b"uuid"
    fields_list.box_size = 1

    assert fields_list.box_size == 1
    assert fields_list.box_type == b"uuid"
    assert fields_list.box_ext_size == MAX_UINT_32 + 1
    assert fields_list.user_type == b":benzina\x00\x00\x00\x00\x00\x00\x00\x00"
    assert bytes(fields_list) == bs.bytes
예제 #2
0
def test_header_fields_list():
    bs = pack("uintbe:32, bytes:4", 100, b"abcd")
    fields_list = flists.BoxHeaderFieldsList()
    fields_list.parse_fields(bs)

    assert fields_list.box_size == 100
    assert fields_list.box_type == b"abcd"
    assert fields_list.box_ext_size is None
    assert fields_list.user_type is None
    assert bytes(fields_list) == bs.bytes
예제 #3
0
def test_header_extended_fields_list():
    bs = pack("uintbe:32, bytes:4, uintbe:64", 1, b"abcd", MAX_UINT_32 + 1)
    fields_list = flists.BoxHeaderFieldsList()
    fields_list.parse_fields(bs)

    assert fields_list.box_size == 1
    assert fields_list.box_type == b"abcd"
    assert fields_list.box_ext_size == MAX_UINT_32 + 1
    assert fields_list.user_type is None
    assert bytes(fields_list) == bs.bytes
예제 #4
0
def test_header_user_type_fields_list():
    bs = pack("uintbe:32, bytes:4, bytes:16", 100, b"uuid",
              b":benzina\x00\x00\x00\x00\x00\x00\x00\x00")
    fields_list = flists.BoxHeaderFieldsList()
    fields_list.parse_fields(bs)

    assert fields_list.box_size == 100
    assert fields_list.box_type == b"uuid"
    assert fields_list.box_ext_size is None
    assert fields_list.user_type == b":benzina\x00\x00\x00\x00\x00\x00\x00\x00"
    assert bytes(fields_list) == bs.bytes