コード例 #1
0
ファイル: test_client.py プロジェクト: FranSal/blaze
def test_client_add_dataset():
    client.requests = test_add  # OMG more monkey patching
    ec = Client('localhost:6363')
    ec.add('iris', example('iris.csv'))
    assert 'iris' in ec.dshape.measure.dict
    iris_data = bz_data(example('iris.csv'))
    assert ec.dshape.measure.dict['iris'] == iris_data.dshape
コード例 #2
0
ファイル: test_client.py プロジェクト: bopopescu/QC
def test_client_add_dataset():
    client.requests = test_add  # OMG more monkey patching
    ec = Client('localhost:6363')
    ec.add('iris', example('iris.csv'))
    assert 'iris' in ec.dshape.measure.dict
    iris_data = bz_data(example('iris.csv'))
    assert ec.dshape.measure.dict['iris'] == iris_data.dshape
コード例 #3
0
ファイル: test_client.py プロジェクト: FranSal/blaze
def test_client_add_dataset_with_args():
    client.requests = test_add  # OMG more monkey patching
    ec = Client('localhost:6363')
    ec.add('teams', 'sqlite:///' + example('teams.db'), 'teams',
           primary_key='teamID')
    assert 'teams' in ec.dshape.measure.dict
    teams_data = bz_data('sqlite:///' + example('teams.db') + '::teams')
    assert ec.dshape.measure.dict['teams'] == teams_data.dshape
コード例 #4
0
ファイル: test_client.py プロジェクト: bopopescu/QC
def test_client_add_dataset_with_args():
    client.requests = test_add  # OMG more monkey patching
    ec = Client('localhost:6363')
    ec.add('teams',
           'sqlite:///' + example('teams.db'),
           'teams',
           primary_key='teamID')
    assert 'teams' in ec.dshape.measure.dict
    teams_data = bz_data('sqlite:///' + example('teams.db') + '::teams')
    assert ec.dshape.measure.dict['teams'] == teams_data.dshape
コード例 #5
0
ファイル: test_client.py プロジェクト: FranSal/blaze
def test_client_add_dataset_failure():
    client.requests = test_add  # OMG more monkey patching
    ec = Client('localhost:6363')
    with pytest.raises(ValueError) as exc:
        ec.add('iris2', example('iris.csv'), -1, bad_arg='value')
    assert '422 UNPROCESSABLE ENTITY' in str(exc.value)
コード例 #6
0
ファイル: test_client.py プロジェクト: FranSal/blaze
def test_client_cant_add_dataset():
    ec = Client('localhost:6363')
    with pytest.raises(ValueError) as excinfo:
        ec.add('iris', example('iris.csv'))
    assert "Server does not support" in str(excinfo.value)
コード例 #7
0
ファイル: test_client.py プロジェクト: bopopescu/QC
def test_client_add_dataset_failure():
    client.requests = test_add  # OMG more monkey patching
    ec = Client('localhost:6363')
    with pytest.raises(ValueError) as exc:
        ec.add('iris2', example('iris.csv'), -1, bad_arg='value')
    assert '422 UNPROCESSABLE ENTITY' in str(exc.value)
コード例 #8
0
ファイル: test_client.py プロジェクト: bopopescu/QC
def test_client_cant_add_dataset():
    ec = Client('localhost:6363')
    with pytest.raises(ValueError) as excinfo:
        ec.add('iris', example('iris.csv'))
    assert "Server does not support" in str(excinfo.value)