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
def test_client_dataset_fails(): with pytest.raises(ValueError): Data('blaze://localhost::accounts') with pytest.raises(ValueError): resource('blaze://localhost::accounts')
def test_resource_non_default_port(): ec = resource('blaze://localhost:6364') assert ec.url == 'http://localhost:6364'
def test_resource_default_port(): ec = resource('blaze://localhost') assert str(discover(ec)) == str(discover(server.datasets))
def test_resource_default_port(app_context): ec = resource('blaze://localhost') assert str(discover(ec)) == str(discover(data))
def test_resource_default_port(): ec = resource('blaze://localhost', 'accounts') assert discover(ec) == discover(df)
def test_resource_all_in_one(): ec = resource('blaze://localhost:6363') assert str(discover(ec)) == str(discover(data))
def test_resource_default_port(): ec = resource('blaze://localhost') assert str(discover(ec)) == str(discover(data))
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
def test_resource_all_in_one(): ec = resource('blaze://localhost:6363') assert str(discover(ec)) == str(discover(server.datasets))
def test_compute_with_dataset(): c = resource('blaze://localhost:6363::accounts') s = Symbol('s', discover(c)) assert compute(s.name, c) == ['Alice', 'Bob']
def test_resource(): c = resource('blaze://localhost:6363') assert isinstance(c, Client) assert str(discover(c)) == str(discover(data))
def test_resource_all_in_one(app_context): ec = resource('blaze://localhost:6363') assert str(discover(ec)) == str(discover(data))
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
def test_clientdataset_into_list(): a = resource('blaze://localhost:6363::accounts') assert into(list, a) == [['Alice', 100], ['Bob', 200]]
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']))
def test_resource(): c = resource('blaze://localhost:6363') assert str(discover(c)) == str(discover(server.datasets))
def test_resource(): ec = resource('blaze://localhost:6363', 'accounts') assert discover(ec) == discover(df)
def test_resource_with_dataset(): c = resource('blaze://localhost:6363::accounts') assert str(discover(c)) == str(discover(df))
def test_resource_all_in_one(): ec = resource('blaze://localhost:6363::accounts') assert discover(ec) == discover(df)
def test_resource(): ec = resource('blaze://localhost:5000', 'accounts_df') assert discover(ec) == discover(df)