예제 #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
파일: test_client.py 프로젝트: vitan/blaze
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
파일: test_client.py 프로젝트: vitan/blaze
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
파일: test_client.py 프로젝트: vitan/blaze
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)