예제 #1
0
파일: test_sql.py 프로젝트: yihongfa/blaze
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
예제 #2
0
파일: test_sql.py 프로젝트: leolujuyi/blaze
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
예제 #3
0
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
예제 #4
0
def test_interactive_len(sql):
    t = Data(sql)
    assert len(t) == int(t.count())
예제 #5
0
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
예제 #6
0
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
예제 #7
0
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
예제 #8
0
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