def __init__(self, attr_type=None, attr=None, required=True, curie=None): """LinkList constructor. :param attr_type: Type, Schema or constant that does item type conversion of the attribute. :param attr: Attribute name, dot-separated attribute path or an `Accessor` instance. :param required: Is this list of links required to be present. :param curie: Link namespace prefix (e.g. "<prefix>:<name>") or Curie object. """ super(LinkList, self).__init__(attr_type=attr_type, attr=attr, required=required, curie=curie) self.attr_type = types.List(self.attr_type)
def test_list(): """Test list.""" type_ = types.List() value = [object(), object()] assert value == type_.serialize(value) assert value == type_.deserialize(value)