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