def test_dict_nested_within_generic(self, value, expected_when_max_size_is_zero, expected_when_max_size_is_none): """Return the appropriate type for dictionaries.""" actual_when_zero = get_type(value, max_typed_dict_size=0) actual_when_none = get_type(value, max_typed_dict_size=VERY_LARGE_MAX_TYPED_DICT_SIZE) assert (types_equal(actual_when_zero, expected_when_max_size_is_zero)) assert (types_equal(actual_when_none, expected_when_max_size_is_none))
def test_shrink_types_non_typed_dict(self, types, expected_type): actual = shrink_types(types, max_typed_dict_size=10) assert types_equal(actual, expected_type)
def test_types_equal(self, typ, other_type, expected_output): assert (types_equal(typ, other_type) == expected_output)