def test_ds_list():
    from rand.providers.ds import RandDatasetBaseProvider, ListDatasetTarget
    db = {'names': [{'name': 'test1'}, {'name': 'test1'}], 'cities': [{'name': 'test2'}, {'name': 'test2'}]}
    ds = RandDatasetBaseProvider(prefix='ds', target=ListDatasetTarget(db=db))
    rand = create_rand()
    rand.register_provider(ds)
    assert (rand.gen('(:ds_get:)', ['names']) == ['test1'])
    assert (rand.gen('(:ds_get_names:)-(:ds_get_cities:)') == ['test1-test2'])
def test_ds_list():
    from rand.providers.ds import RandDatasetBaseProvider, ListDatasetTarget
    db = {'names': [{'name': 'test1'}, {'name': 'test1'}], 'cities': [{'name': 'test2'}, {'name': 'test2'}]}
    ds = RandDatasetBaseProvider(prefix='ds', target=ListDatasetTarget(db=db))
    rand = create_rand()
    rand.register_provider(ds)
    assert (rand.gen('(:ds_get:)', ['names']) == ['test1'])
    assert (rand.gen('(:ds_get_names:)-(:ds_get_cities:)') == ['test1-test2'])