def test_column(sql): t = Data(sql) r = list(t['x']) assert r == [1, 10, 100] assert list(t[['x']]) == [(1,), (10,), (100,)] assert int(t.count()) == 3
def test_column(sql): t = Data(sql) r = compute(t['x']) assert r == [1, 10, 100] assert compute(t[['x']]) == [(1,), (10,), (100,)] assert compute(t.count()) == 3
def test_column(sql): t = Data(sql) r = compute(t['x']) assert r == [1, 10, 100] assert compute(t[['x']]) == [(1, ), (10, ), (100, )] assert compute(t.count()) == 3
def test_interactive_len(sql): t = Data(sql) assert len(t) == int(t.count())
def test_Data_construct_with_table(bank): d = Data('mongodb://localhost/test_db::bank') assert set(d.fields) == set(('name', 'amount')) assert int(d.count()) == 5
def test_Data_construct_with_table(bank, mongo_host_port): d = Data('mongodb://{}:{}/test_db::bank'.format(*mongo_host_port)) assert set(d.fields) == set(('name', 'amount')) assert int(d.count()) == 5