Exemplo n.º 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
Exemplo n.º 2
0
def test_client_dataset_fails():
    with pytest.raises(ValueError):
        Data('blaze://localhost::accounts')
    with pytest.raises(ValueError):
        resource('blaze://localhost::accounts')
Exemplo n.º 3
0
def test_resource_non_default_port():
    ec = resource('blaze://localhost:6364')
    assert ec.url == 'http://localhost:6364'
Exemplo n.º 4
0
def test_resource_default_port():
    ec = resource('blaze://localhost')
    assert str(discover(ec)) == str(discover(server.datasets))
Exemplo n.º 5
0
def test_resource_default_port(app_context):
    ec = resource('blaze://localhost')
    assert str(discover(ec)) == str(discover(data))
Exemplo n.º 6
0
def test_resource_default_port():
    ec = resource('blaze://localhost', 'accounts')
    assert discover(ec) == discover(df)
Exemplo n.º 7
0
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(data))
Exemplo n.º 8
0
def test_resource_default_port():
    ec = resource('blaze://localhost')
    assert str(discover(ec)) == str(discover(data))
Exemplo n.º 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
Exemplo n.º 10
0
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(server.datasets))
Exemplo n.º 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']
Exemplo n.º 12
0
def test_resource():
    c = resource('blaze://localhost:6363')
    assert isinstance(c, Client)
    assert str(discover(c)) == str(discover(data))
Exemplo n.º 13
0
def test_client_dataset_fails():
    with pytest.raises(ValueError):
        Data('blaze://localhost::accounts')
    with pytest.raises(ValueError):
        resource('blaze://localhost::accounts')
Exemplo n.º 14
0
def test_resource_all_in_one(app_context):
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(data))
Exemplo n.º 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
Exemplo n.º 16
0
def test_clientdataset_into_list():
    a = resource('blaze://localhost:6363::accounts')

    assert into(list, a) == [['Alice', 100], ['Bob', 200]]
Exemplo n.º 17
0
def test_resource():
    c = resource('blaze://localhost:6363')
    assert isinstance(c, Client)
    assert str(discover(c)) == str(discover(data))
Exemplo n.º 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']))
Exemplo n.º 19
0
def test_resource_non_default_port():
    ec = resource('blaze://localhost:6364')
    assert ec.url == 'http://localhost:6364'
Exemplo n.º 20
0
def test_resource():
    c = resource('blaze://localhost:6363')
    assert str(discover(c)) == str(discover(server.datasets))
Exemplo n.º 21
0
def test_resource():
    ec = resource('blaze://localhost:6363', 'accounts')
    assert discover(ec) == discover(df)
Exemplo n.º 22
0
def test_resource_with_dataset():
    c = resource('blaze://localhost:6363::accounts')
    assert str(discover(c)) == str(discover(df))
Exemplo n.º 23
0
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363::accounts')
    assert discover(ec) == discover(df)
Exemplo n.º 24
0
def test_resource():
    ec = resource('blaze://localhost:5000', 'accounts_df')
    assert discover(ec) == discover(df)