def these_sentences_are_returned(context, feature): assert_status_code_ok(context.response) assert_response_for_feature(map(pluck('sentence'), context.table), feature, context.response)
def test_pluck_with_key_that_exists(self): self.assertEqual('Adam', pluck('name')(dict(name='Adam')))
def test_pluck_with_key_that_does_not_exist(self): self.assertRaises(KeyError, lambda: pluck('name')(dict()))
def actual_sentences_from(response_data): return map(pluck('sentence'), response_data['sentences'])