예제 #1
0
def test_list_pull_dicts():
    test_data = [{'foo': 'bar1'}, {'foo': 'bar2'}]

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

    assert list_pull(test_data, "foo") == ["bar1", "bar2"]
예제 #6
0
def test_list_pull():
    assert list_pull([], "foo") == []
예제 #7
0
def test_pull_objects():
    TestObject = namedtuple("TestObject", "bar")
    test_objs = [TestObject(bar=2), TestObject(bar=3)]
    assert list_pull(test_objs, "bar") == [2, 3]