def test_list_stream(self):
     packed_value = b"\xD7\x01\x02\x03\xDF"
     unpacked_value = [1, 2, 3]
     stream_out = BytesIO()
     packer = Packer(stream_out)
     packer.pack_list_stream_header()
     packer.pack(1)
     packer.pack(2)
     packer.pack(3)
     packer.pack_end_of_stream()
     packed = stream_out.getvalue()
     try:
         assert packed == packed_value
     except AssertionError:
         raise AssertionError("Packed value is %r instead of expected %r" %
                              (packed, packed_value))
     stream_in = BytesIO(packed)
     unpacker = Unpacker(stream_in)
     unpacked = next(unpacker.unpack())
     try:
         assert unpacked == unpacked_value
     except AssertionError:
         raise AssertionError(
             "Unpacked value %r is not equal to expected %r" %
             (unpacked, unpacked_value))
 def test_list_stream(self):
     packed_value = b"\xD7\x01\x02\x03\xDF"
     unpacked_value = [1, 2, 3]
     stream_out = BytesIO()
     packer = Packer(stream_out)
     packer.pack_list_stream_header()
     packer.pack(1)
     packer.pack(2)
     packer.pack(3)
     packer.pack_end_of_stream()
     packed = stream_out.getvalue()
     try:
         assert packed == packed_value
     except AssertionError:
         raise AssertionError("Packed value is %r instead of expected %r" %
                              (packed, packed_value))
     stream_in = BytesIO(packed)
     unpacker = Unpacker(stream_in)
     unpacked = next(unpacker.unpack())
     try:
         assert unpacked == unpacked_value
     except AssertionError:
         raise AssertionError("Unpacked value %r is not equal to expected %r" %
                              (unpacked, unpacked_value))