diff --git a/swh/model/hypothesis_strategies.py b/swh/model/hypothesis_strategies.py index da04769df07274b2c41fcb4642097a9cbe11e560..99573e2327dabbc148c5275a2b9ab59bd6fcb259 100644 --- a/swh/model/hypothesis_strategies.py +++ b/swh/model/hypothesis_strategies.py @@ -175,7 +175,9 @@ def origin_visit_statuses_d(): visit=integers(1, 1000), origin=urls(), type=optional(sampled_from(["git", "svn", "pypi", "debian"])), - status=sampled_from(["created", "ongoing", "full", "partial"]), + status=sampled_from( + ["created", "ongoing", "full", "partial", "not_found", "failed"] + ), date=aware_datetimes(), snapshot=optional(sha1_git()), metadata=optional(metadata_dicts()), diff --git a/swh/model/model.py b/swh/model/model.py index e373e2065be760b86168ef93e3fa34f65f90daef..10b39f208c37f278b68bca42d746b15f9d89c096 100644 --- a/swh/model/model.py +++ b/swh/model/model.py @@ -320,7 +320,9 @@ class OriginVisitStatus(BaseModel): date = attr.ib(type=datetime.datetime, validator=type_validator()) status = attr.ib( type=str, - validator=attr.validators.in_(["created", "ongoing", "full", "partial"]), + validator=attr.validators.in_( + ["created", "ongoing", "full", "partial", "not_found", "failed"] + ), ) snapshot = attr.ib(type=Optional[Sha1Git], validator=type_validator()) # Type is optional be to able to use it before adding it to the database model