swh.model.hypothesis_strategies module#
- 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.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.revision_metadata()#
- swh.model.hypothesis_strategies.directories_d(raw_manifest=one_of(none(), binary())) SearchStrategy [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.branch_targets_object_d()#
- swh.model.hypothesis_strategies.branch_targets_alias_d()#
- swh.model.hypothesis_strategies.branch_targets_d(*, only_objects=False)#
- swh.model.hypothesis_strategies.snapshots_d(*, min_size=0, max_size=100, only_objects=False) SearchStrategy [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”.