DictSubject

DictSubject.new

DictSubject.new(actual, meta, container_name=”dict”, key_plural_name=”keys”)

Creates a new DictSubject.

Method: DictSubject.new

PARAMETERS

actual:

(dict) the dict to assert against.

meta:

(ExpectMeta) of call chain information.

container_name:

(default "dict") (str) conceptual name of the dict.

key_plural_name:

(default "keys") (str) the plural word for the keys of the dict.

RETURNS

New DictSubject struct.

DictSubject.contains_at_least

DictSubject.contains_at_least(at_least)

Assert the dict has at least the entries from at_least.

Method: DictSubject.contains_at_least

PARAMETERS

at_least:

(dict) the subset of keys/values that must exist. Extra keys are allowed. Order is not checked.

DictSubject.contains_exactly

DictSubject.contains_exactly(expected)

Assert the dict has exactly the provided values.

Method: DictSubject.contains_exactly

PARAMETERS

expected:

(dict) the values that must exist. Missing values or extra values are not allowed. Order is not checked.

DictSubject.contains_none_of

DictSubject.contains_none_of(none_of)

Assert the dict contains none of none_of keys/values.

Method: DictSubject.contains_none_of

PARAMETERS

none_of:

(dict) the keys/values that must not exist. Order is not checked.

DictSubject.keys

DictSubject.keys()

Returns a CollectionSubject for the dict’s keys.

Method: DictSubject.keys

RETURNS

CollectionSubject of the keys.