Beispiel #1
0
def test_client_import(localhost, auth_token):
    client = PGDBClient(localhost, token=auth_token)
    with pytest.raises(ClientError):
        client.import_corpus('test', 'acoustic', 'M', 'test_database')

    client.start_database('test_database')
    client.import_corpus('test', 'acoustic', 'M', 'test_database', blocking=True)

    client.stop_database('test_database')
    assert client.corpus_status('test')['status'] == 'Imported'
    assert 'test' in [x['name'] for x in client.list_corpora('test_database')]
Beispiel #2
0
def test_client_import(localhost):
    client = PGDBClient(localhost)
    with pytest.raises(ClientError):
        client.import_corpus('test', 'acoustic', 'M', 'test_database')

    client.start_database('test_database')
    client.import_corpus('test',
                         'acoustic',
                         'M',
                         'test_database',
                         blocking=True)

    client.stop_database('test_database')
    assert client.corpus_status('test') == 'Imported'
    assert 'test' in client.list_corpora('test_database')