def test_assert_keys_have_values_fails(): """KeyNotInContextError if list of keys not all in context with values.""" with pytest.raises(KeyNotInContextError): context = Context({ 'key1': 'value1', 'key2': 'value2', 'key3': 'value3' }) context.assert_keys_have_values( None, 'key1', 'key4', 'key2', )
def test_assert_keys_have_values_passes(): """Pass if list of keys all found in context dictionary.""" context = Context({'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}) context.assert_keys_have_values(None, 'key1', 'key3')