| 91 | [(BytesSubclass(b'foo'), 'foo'), (BytesMixin(b'foo'), 'foo'), (BytesEnum.foo, 'foo-value')], |
| 92 | ) |
| 93 | def test_subclass_bytes(schema_type, input_value, expected_json): |
| 94 | s = SchemaSerializer({'type': schema_type}) |
| 95 | v = s.to_python(input_value) |
| 96 | assert v == input_value |
| 97 | assert type(v) == type(input_value) |
| 98 | |
| 99 | v = s.to_python(input_value, mode='json') |
| 100 | assert v == expected_json |
| 101 | assert type(v) == str |
| 102 | |
| 103 | assert s.to_json(input_value) == json.dumps(expected_json).encode('utf-8') |
| 104 | |
| 105 | |
| 106 | def test_bytes_base64(): |