diff --git a/swh/model/hypothesis_strategies.py b/swh/model/hypothesis_strategies.py --- a/swh/model/hypothesis_strategies.py +++ b/swh/model/hypothesis_strategies.py @@ -157,9 +157,9 @@ visit=integers(1, 1000), origin=urls(), date=aware_datetimes(), - status=sampled_from(["ongoing", "full", "partial"]), type=pgsql_text(), - snapshot=optional(sha1_git()), + status=none(), + snapshot=none(), metadata=none(), ) diff --git a/swh/model/model.py b/swh/model/model.py --- a/swh/model/model.py +++ b/swh/model/model.py @@ -233,16 +233,15 @@ origin = attr.ib(type=str, validator=type_validator()) date = attr.ib(type=datetime.datetime, validator=type_validator()) - status = attr.ib( - type=str, validator=attr.validators.in_(["ongoing", "full", "partial"]) - ) type = attr.ib(type=str, validator=type_validator()) - snapshot = attr.ib(type=Optional[Sha1Git], validator=type_validator()) + """Should not be set before calling 'origin_visit_add()'.""" + visit = attr.ib(type=Optional[int], validator=type_validator(), default=None) + + status = attr.ib(type=Optional[str], validator=type_validator(), default=None) + snapshot = attr.ib(type=Optional[Sha1Git], validator=type_validator(), default=None) metadata = attr.ib( type=Optional[Dict[str, object]], validator=type_validator(), default=None ) - visit = attr.ib(type=Optional[int], validator=type_validator(), default=None) - """Should not be set before calling 'origin_visit_add()'.""" def to_dict(self): """Serializes the date as a string and omits the visit id if it is