Пример #1
0
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
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