def test_list_pull_dicts(): test_data = [{'foo': 'bar1'}, {'foo': 'bar2'}] assert list_pull(test_data, 'foo') == ['bar1', 'bar2']
def get_run_ids(self): return list_pull(self.get_run_metas(), 'run_id')
def test_list_pull(): assert list_pull([], 'foo') == []
def test_pull_objects(): TestObject = namedtuple('TestObject', 'bar') test_objs = [TestObject(bar=2), TestObject(bar=3)] assert list_pull(test_objs, 'bar') == [2, 3]
def test_list_pull_dicts(): test_data = [{"foo": "bar1"}, {"foo": "bar2"}] assert list_pull(test_data, "foo") == ["bar1", "bar2"]
def test_list_pull(): assert list_pull([], "foo") == []
def test_pull_objects(): TestObject = namedtuple("TestObject", "bar") test_objs = [TestObject(bar=2), TestObject(bar=3)] assert list_pull(test_objs, "bar") == [2, 3]