Esempio n. 1
0
def test_unpacking_packing_header_with_length():
    """ Test for header (with length) for packing and unpacking
    """
    tested_header = Header(SegTag.IVT2, length=10)
    packed_header = tested_header.export()
    unpacked = tested_header.parse(packed_header)
    assert unpacked == tested_header
Esempio n. 2
0
def test_comparision_header_without_length():
    """Test for comparing header and header 2 (without lenght) for packing and unpacking"""
    tested_header2 = Header2(SegTag.IVT2)
    tested_header = Header(SegTag.IVT2)
    packed_header2 = tested_header2.export()
    packed_header = tested_header.export()
    unpacked2 = tested_header2.parse(packed_header2)
    unpacked = tested_header.parse(packed_header)
    assert unpacked2 != unpacked
    assert packed_header2 != packed_header