()
| 28 | |
| 29 | |
| 30 | def test_uuid_key(): |
| 31 | v = SchemaSerializer(core_schema.dict_schema(core_schema.uuid_schema(), core_schema.uuid_schema())) |
| 32 | assert v.to_python( |
| 33 | {UUID('12345678-1234-5678-1234-567812345678'): UUID('12345678-1234-5678-1234-567812345678')} |
| 34 | ) == {UUID('12345678-1234-5678-1234-567812345678'): UUID('12345678-1234-5678-1234-567812345678')} |
| 35 | assert v.to_python( |
| 36 | {UUID('12345678-1234-5678-1234-567812345678'): UUID('12345678-1234-5678-1234-567812345678')}, mode='json' |
| 37 | ) == {'12345678-1234-5678-1234-567812345678': '12345678-1234-5678-1234-567812345678'} |
| 38 | assert ( |
| 39 | v.to_json({UUID('12345678-1234-5678-1234-567812345678'): UUID('12345678-1234-5678-1234-567812345678')}) |
| 40 | == b'{"12345678-1234-5678-1234-567812345678":"12345678-1234-5678-1234-567812345678"}' |
| 41 | ) |
| 42 | |
| 43 | |
| 44 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected