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.dumps
to 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.date
values.
-
swaggerconformance.strategies.
times
()[source]¶ Hypothesis strategy for generating
datetime.time
values.
-
swaggerconformance.strategies.
datetimes
()[source]¶ Hypothesis strategy for generating
datetime.datetime
values.
-
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
file
format 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.