def test_ds_db():
    from rand.providers.ds import RandDatasetBaseProvider, DBDatasetTarget
    rows = [{'name': 'test'}, {'name': 'test'}]
    db = prepare_database_with_table('names', rows)
    ds = RandDatasetBaseProvider(prefix='ds', target=DBDatasetTarget(db=db))
    rand = create_rand()
    rand.register_provider(ds)
    assert (rand.gen('(:ds_get:)', ['names']) == ['test'])
def test_ds_db():
    from rand.providers.ds import RandDatasetBaseProvider, DBDatasetTarget
    rows = [{'name': 'test'}, {'name': 'test'}]
    db = prepare_database_with_table('names', rows)
    ds = RandDatasetBaseProvider(prefix='ds', target=DBDatasetTarget(db=db))
    rand = create_rand()
    rand.register_provider(ds)
    assert (rand.gen('(:ds_get:)', ['names']) == ['test'])