swh.model.hypothesis_strategies module#

swh.model.hypothesis_strategies.optional(strategy)[source]#
swh.model.hypothesis_strategies.pgsql_text()[source]#
swh.model.hypothesis_strategies.sha1_git()[source]#
swh.model.hypothesis_strategies.sha1()[source]#
swh.model.hypothesis_strategies.binaries_without_bytes(blacklist: Sequence[int])[source]#

Like hypothesis.strategies.binary, but takes a sequence of bytes that should not be included.

swh.model.hypothesis_strategies.extended_swhids() SearchStrategy[source]#
swh.model.hypothesis_strategies.aware_datetimes()[source]#
swh.model.hypothesis_strategies.iris() SearchStrategy[source]#
swh.model.hypothesis_strategies.persons_d() SearchStrategy[source]#
swh.model.hypothesis_strategies.persons(**kwargs)[source]#
swh.model.hypothesis_strategies.timestamps_d(**kwargs)[source]#
swh.model.hypothesis_strategies.timestamps()[source]#
swh.model.hypothesis_strategies.timestamps_with_timezone_d(*, timestamp=builds(dict, microseconds=integers(min_value=0, max_value=999999), seconds=integers(min_value=-62135596799.0, max_value=253402300799.0)), offset=integers(min_value=-840, max_value=840), negative_utc=booleans()) SearchStrategy[source]#
swh.model.hypothesis_strategies.origins_d(*, url=iris().filter(lambda iri: ...))[source]#
swh.model.hypothesis_strategies.origins(**kwargs)[source]#
swh.model.hypothesis_strategies.origin_visits_d(**kwargs)[source]#
swh.model.hypothesis_strategies.origin_visits(**kwargs)[source]#
swh.model.hypothesis_strategies.metadata_dicts()[source]#
swh.model.hypothesis_strategies.origin_visit_statuses_d(**kwargs)[source]#
swh.model.hypothesis_strategies.origin_visit_statuses(**kwargs)[source]#
swh.model.hypothesis_strategies.releases_d(**kwargs) SearchStrategy[source]#
swh.model.hypothesis_strategies.releases(**kwargs)[source]#
swh.model.hypothesis_strategies.revision_metadata()#
swh.model.hypothesis_strategies.extra_headers()[source]#
swh.model.hypothesis_strategies.revisions_d(**kwargs) SearchStrategy[source]#
swh.model.hypothesis_strategies.revisions(**kwargs)[source]#
swh.model.hypothesis_strategies.directory_entries_d(**kwargs)[source]#
swh.model.hypothesis_strategies.directory_entries(**kwargs)[source]#
swh.model.hypothesis_strategies.directories_d(raw_manifest=one_of(none(), binary())) SearchStrategy[source]#
swh.model.hypothesis_strategies.directories(**kwargs)[source]#
swh.model.hypothesis_strategies.contents_d()[source]#
swh.model.hypothesis_strategies.contents()[source]#
swh.model.hypothesis_strategies.present_contents_d(**kwargs)[source]#
swh.model.hypothesis_strategies.present_contents(**kwargs)[source]#
swh.model.hypothesis_strategies.skipped_contents_d(reason=text(alphabet=characters(blacklist_categories=['Cs'], blacklist_characters=['\x00'])), status=just('absent'), ctime=one_of(none(), datetimes(min_value=datetime.datetime(2000, 1, 1, 0, 0), timezones=timezones()))) SearchStrategy[source]#
swh.model.hypothesis_strategies.skipped_contents(**kwargs)[source]#
swh.model.hypothesis_strategies.branch_names()[source]#
swh.model.hypothesis_strategies.snapshot_targets_object_d()[source]#
swh.model.hypothesis_strategies.branch_targets_object_d()#
swh.model.hypothesis_strategies.snapshot_targets_alias_d()[source]#
swh.model.hypothesis_strategies.branch_targets_alias_d()#
swh.model.hypothesis_strategies.snapshot_targets_d(*, only_objects=False)[source]#
swh.model.hypothesis_strategies.branch_targets_d(*, only_objects=False)#
swh.model.hypothesis_strategies.snapshot_targets(*, only_objects=False)[source]#
swh.model.hypothesis_strategies.snapshots_d(*, min_size=0, max_size=100, only_objects=False) SearchStrategy[source]#
swh.model.hypothesis_strategies.snapshots(*, min_size=0, max_size=100, only_objects=False)[source]#
swh.model.hypothesis_strategies.metadata_authorities(url=iris())[source]#
swh.model.hypothesis_strategies.metadata_fetchers(**kwargs)[source]#
swh.model.hypothesis_strategies.raw_extrinsic_metadata(**kwargs)[source]#
swh.model.hypothesis_strategies.raw_extrinsic_metadata_d(**kwargs)[source]#
swh.model.hypothesis_strategies.objects(blacklist_types: Set[ModelObjectType] | Any = {ModelObjectType.ORIGIN_VISIT_STATUS}, split_content: bool = False)[source]#

generates a random couple (type, obj)

which obj is an instance of the Model class corresponding to obj_type.

blacklist_types is a list of obj_type to exclude from the strategy.

If split_content is True, generates Content and SkippedContent under different obj_type, resp. “content” and “skipped_content”.

swh.model.hypothesis_strategies.object_dicts(blacklist_types=(ModelObjectType.ORIGIN_VISIT_STATUS,), split_content=False)[source]#

generates a random couple (type, dict)

which dict is suitable for <ModelForType>.from_dict() factory methods.

blacklist_types is a list of obj_type to exclude from the strategy.

If split_content is True, generates Content and SkippedContent under different obj_type, resp. “content” and “skipped_content”.