コード例 #1
0
ファイル: test_client.py プロジェクト: leolujuyi/blaze
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
ファイル: test_client.py プロジェクト: leolujuyi/blaze
def test_resource_non_default_port():
    ec = resource('blaze://localhost:6364')
    assert ec.url == 'http://localhost:6364'
コード例 #4
0
ファイル: test_client.py プロジェクト: leolujuyi/blaze
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
ファイル: test_client.py プロジェクト: somu-analyst/blaze
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(data))
コード例 #8
0
ファイル: test_client.py プロジェクト: somu-analyst/blaze
def test_resource_default_port():
    ec = resource('blaze://localhost')
    assert str(discover(ec)) == str(discover(data))
コード例 #9
0
ファイル: test_client.py プロジェクト: leolujuyi/blaze
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
ファイル: test_client.py プロジェクト: leolujuyi/blaze
def test_resource_all_in_one():
    ec = resource('blaze://localhost:6363')
    assert str(discover(ec)) == str(discover(server.datasets))
コード例 #11
0
ファイル: test_client.py プロジェクト: leolujuyi/blaze
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
ファイル: test_client.py プロジェクト: CaptainAL/Spyder
def test_resource():
    c = resource('blaze://localhost:6363')
    assert isinstance(c, Client)
    assert str(discover(c)) == str(discover(data))
コード例 #13
0
ファイル: test_client.py プロジェクト: CaptainAL/Spyder
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
ファイル: test_client.py プロジェクト: somu-analyst/blaze
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
ファイル: test_client.py プロジェクト: leolujuyi/blaze
def test_clientdataset_into_list():
    a = resource('blaze://localhost:6363::accounts')

    assert into(list, a) == [['Alice', 100], ['Bob', 200]]
コード例 #17
0
ファイル: test_client.py プロジェクト: somu-analyst/blaze
def test_resource():
    c = resource('blaze://localhost:6363')
    assert isinstance(c, Client)
    assert str(discover(c)) == str(discover(data))
コード例 #18
0
ファイル: test_client.py プロジェクト: leolujuyi/blaze
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
ファイル: test_client.py プロジェクト: somu-analyst/blaze
def test_resource_non_default_port():
    ec = resource('blaze://localhost:6364')
    assert ec.url == 'http://localhost:6364'
コード例 #20
0
ファイル: test_client.py プロジェクト: leolujuyi/blaze
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
ファイル: test_client.py プロジェクト: leolujuyi/blaze
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
ファイル: test_client.py プロジェクト: quasiben/blaze
def test_resource():
    ec = resource('blaze://localhost:5000', 'accounts_df')
    assert discover(ec) == discover(df)