예제 #1
0
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)
예제 #2
0
 def test_pluck_with_key_that_exists(self):
     self.assertEqual('Adam', pluck('name')(dict(name='Adam')))
예제 #3
0
 def test_pluck_with_key_that_does_not_exist(self):
     self.assertRaises(KeyError, lambda: pluck('name')(dict()))
예제 #4
0
def actual_sentences_from(response_data):
    return map(pluck('sentence'), response_data['sentences'])