forked from HypothesisWorks/hypothesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
merge_dicts.txt
23 lines (20 loc) · 832 Bytes
/
merge_dicts.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# This test code was written by the `hypothesis.extra.ghostwriter` module
# and is provided under the Creative Commons Zero public domain dedication.
import collections.abc
import example_code.future_annotations
from collections import ChainMap
from hypothesis import given, strategies as st
@given(
map1=st.one_of(
st.dictionaries(keys=st.text(), values=st.integers()),
st.dictionaries(keys=st.text(), values=st.integers()).map(ChainMap),
),
map2=st.one_of(
st.dictionaries(keys=st.text(), values=st.integers()),
st.dictionaries(keys=st.text(), values=st.integers()).map(ChainMap),
),
)
def test_fuzz_merge_dicts(
map1: collections.abc.Mapping[str, int], map2: collections.abc.Mapping[str, int]
) -> None:
example_code.future_annotations.merge_dicts(map1=map1, map2=map2)