@pytest.mark.parametrize('s, val, out', [
(b'foo', b'foo', b'foo'),
('foo', b'foo', b'foo'),
(u'foo', b'foo', b'foo'),
])
def test_text_round_trip_binary(s, val, out):
if out is None:
out = s
wire_val = BinaryTypeSpec.to_wire(s)
assert wire_val == BinaryValue(val)
assert BinaryTypeSpec.from_wire(wire_val) == out
tests/spec/test_primitive.py:55: in test_text_round_trip_binary
wire_val = BinaryTypeSpec.to_wire(s)
thriftrw/spec/primitive.py:67: in to_wire
check.instanceof_surface(self, value)
thriftrw/spec/check.py:55: in instanceof_surface
instanceof_class(type_spec, type_spec.surface, value)
thriftrw/spec/check.py:61: in instanceof_class
'Cannot serialize %r into a "%s".' % (value, type_spec.name)
E TypeError: Cannot serialize u'foo' into a "binary".
@junchaowu @breerly @kriskowal