示例#1
0
def test_compute_multiple_client_datasets():
    a1 = resource('blaze://localhost:6363::accounts')
    a2 = resource('blaze://localhost:6363::accounts2')
    s1 = Symbol('s1', discover(a1))
    s2 = Symbol('s2', discover(a2))

    assert compute(s1.amount.sum() + s2.amount.sum(),
            {s1: a1, s2: a2}) == 600
示例#2
0
def test_client_dataset_fails():
    with pytest.raises(ValueError):
        Data('blaze://localhost::accounts')
    with pytest.raises(ValueError):
        resource('blaze://localhost::accounts')
示例#3
0
def test_resource_non_default_port():
    ec = resource('blaze://localhost:6364')
    assert ec.url == 'http://localhost:6364'
示例#4
0
def test_resource_default_port():
    ec = resource('blaze://localhost')
    assert str(discover(ec)) == str(discover(server.datasets))
示例#5
0
def test_resource_default_port(app_context):
    ec = resource('blaze://localhost')
    assert str(discover(ec)) == str(discover(data))
示例#6
0
def test_resource_default_port():
    ec = resource('blaze://localhost', 'accounts')
    assert discover(ec) == discover(df)
示例#7
0
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(data))
示例#8
0
def test_resource_default_port():
    ec = resource('blaze://localhost')
    assert str(discover(ec)) == str(discover(data))
示例#9
0
def test_compute_client_with_multiple_datasets():
    c = resource('blaze://localhost:6363')
    s = Symbol('s', discover(c))

    assert compute(s.accounts.amount.sum() + s.accounts2.amount.sum(),
                    {s: c}) == 600
示例#10
0
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(server.datasets))
示例#11
0
def test_compute_with_dataset():
    c = resource('blaze://localhost:6363::accounts')
    s = Symbol('s', discover(c))

    assert compute(s.name, c) == ['Alice', 'Bob']
示例#12
0
def test_resource():
    c = resource('blaze://localhost:6363')
    assert isinstance(c, Client)
    assert str(discover(c)) == str(discover(data))
示例#13
0
def test_client_dataset_fails():
    with pytest.raises(ValueError):
        Data('blaze://localhost::accounts')
    with pytest.raises(ValueError):
        resource('blaze://localhost::accounts')
示例#14
0
def test_resource_all_in_one(app_context):
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(data))
示例#15
0
def test_compute_client_with_multiple_datasets():
    c = resource('blaze://localhost:6363')
    s = symbol('s', discover(c))

    assert compute(s.accounts.amount.sum() + s.accounts2.amount.sum(),
                   {s: c}) == 600
示例#16
0
def test_clientdataset_into_list():
    a = resource('blaze://localhost:6363::accounts')

    assert into(list, a) == [['Alice', 100], ['Bob', 200]]
示例#17
0
def test_resource():
    c = resource('blaze://localhost:6363')
    assert isinstance(c, Client)
    assert str(discover(c)) == str(discover(data))
示例#18
0
def test_clientdataset_into_list():
    a = resource('blaze://localhost:6363::accounts')

    assert str(into(DataFrame, a)) == \
            str(DataFrame([['Alice', 100], ['Bob', 200]],
                          columns=['name', 'amount']))
示例#19
0
def test_resource_non_default_port():
    ec = resource('blaze://localhost:6364')
    assert ec.url == 'http://localhost:6364'
示例#20
0
def test_resource():
    c = resource('blaze://localhost:6363')
    assert str(discover(c)) == str(discover(server.datasets))
示例#21
0
def test_resource():
    ec = resource('blaze://localhost:6363', 'accounts')
    assert discover(ec) == discover(df)
示例#22
0
def test_resource_with_dataset():
    c = resource('blaze://localhost:6363::accounts')
    assert str(discover(c)) == str(discover(df))
示例#23
0
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363::accounts')
    assert discover(ec) == discover(df)
示例#24
0
def test_resource():
    ec = resource('blaze://localhost:5000', 'accounts_df')
    assert discover(ec) == discover(df)