예제 #1
0
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
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
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
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)