def test_queue_identifier_field_invalid_inputs(queue_identifier): serialized = QueueIdentifierField()._serialize(queue_identifier, None, None) wrong_delimiter = serialized.replace("|", ":") # TODO check for address and chain/channel id validity in QueueIdentifier too, add tests here for string in (wrong_delimiter,): with pytest.raises(marshmallow.exceptions.ValidationError): QueueIdentifierField()._deserialize(string, None, None)
def test_deserialize_raises_validation_error_on_dict(): for field in [ IntegerToStringField(), OptionalIntegerToStringField(), BytesField(), AddressField(), QueueIdentifierField(), ]: with pytest.raises(marshmallow.exceptions.ValidationError): field._deserialize({}, None, None)
def test_queue_identifier_field_roundtrip(queue_identifier): assert_roundtrip(QueueIdentifierField(), queue_identifier)