Пример #1
0
def test_create():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexApp = IndexApp(client)
    ret = indexApp.create(index_name, 'tpl_test')
    print(ret)
    assert ret['status'] == 'OK'
    time.sleep(2)
Пример #2
0
def test_get_all_page():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexApp = IndexApp(client)
    ret = indexApp.getAll(page=1, size=50)
    print(ret)
    assert ret['status'] == 'OK'
    print(ret['result'])
Пример #3
0
def test_create():
    client = Client(app_key, app_secret, base_url)
    indexApp = IndexApp(client)
    ret = yield from indexApp.create(index_name, 'tpl_test')
    client.session.close()
    assert ret['status'] == 'OK'
    time.sleep(5)
Пример #4
0
def test_status():
    client = Client(app_key, app_secret, base_url)
    indexApp = IndexApp(client)
    ret = yield from indexApp.status(index_name)
    client.session.close()
    assert ret['status'] == 'OK'
    print(ret['result'])
Пример #5
0
def test_delete():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexApp = IndexApp(client)
    ret = indexApp.delete(index_name)
    assert ret['status'] == 'OK'
Пример #6
0
def test_status():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexApp = IndexApp(client)
    ret = indexApp.status(index_name)
    assert ret['status'] == 'OK'
    print(ret['result'])
Пример #7
0
def test_app_delete():
    client = Client(app_key, app_secret, base_url)
    indexApp = IndexApp(client)
    ret = yield from indexApp.delete(index_name)
    client.session.close()
    assert ret['status'] == 'OK'
Пример #8
0
def test_rebuild():
    client = Client(app_key, app_secret, base_url, lib=client_name)
    indexApp = IndexApp(client)
    ret = indexApp.rebuild(index_name, 'createtask', table_name=table_name)
    print(ret)
    assert ret['status'] == 'OK'