swaggerconformance.strategies module¶
Extra hypothesis strategies built from those in hypothesis.strategies, and
helper functions for merging dictionary type strategies and dictionaries of
strategies.
-
swaggerconformance.strategies.json(value_limit=5)[source]¶ Hypothesis strategy for generating values that can be passed to
json.dumpsto produce valid JSON data.Parameters: value_limit (int) – A limit on the number of values in the JSON data - setting this too high can cause value generation to time out.
-
swaggerconformance.strategies.dates()[source]¶ Hypothesis strategy for generating
datetime.datevalues.
-
swaggerconformance.strategies.times()[source]¶ Hypothesis strategy for generating
datetime.timevalues.
-
swaggerconformance.strategies.datetimes()[source]¶ Hypothesis strategy for generating
datetime.datetimevalues.
-
swaggerconformance.strategies.file_objects()[source]¶ Hypothesis strategy for generating pre-populated
file objects.
-
swaggerconformance.strategies.files()[source]¶ Hypothesis strategy for generating objects pyswagger can use as file handles to populate
fileformat parameters.Generated values take the format:
dict('data': <file object>)
-
swaggerconformance.strategies.merge_dicts_strategy(dict_strat_1, dict_strat_2)[source]¶ Strategy merging two strategies producting dicts into one.
-
swaggerconformance.strategies.merge_dicts_max_size_strategy(dict1, dict2, max_size)[source]¶ Combine dict strategies into one to produce a dict up to a max size.
Assumes both dicts have distinct keys.
Parameters: max_size (int) – Maximum number of keys in dicts generated by the strategy.