Beispiel #1
0
def run_test_context(collection, bucket, object, text):
    client = pysonic.Client()
    with client.mode('ingest') as c:
        c.push(collection, bucket, object, text)
    yield
    with client.mode('ingest') as c:
        r = c.flushc(collection)
        print(r)
Beispiel #2
0
def test_flushb():
    client = pysonic.Client()
    with client.mode('ingest') as c:
        resp = c.flushb("test", "test")
        assert resp == ['product_1']
Beispiel #3
0
def test_suggest(collection, bucket):
    client = pysonic.Client()
    with client.mode('search') as c:
        assert c.suggest(collection, bucket, "engli") == ['english']
Beispiel #4
0
def test_query(collection, bucket, object):
    client = pysonic.Client()
    with client.mode('search') as c:
        resp = c.query(collection, bucket, "This is a test text in english")
        assert resp == [object]
Beispiel #5
0
def test_ingest():
    client = pysonic.Client()
    with client.mode('ingest') as c:
        c.push("test", "test", "product 22", "this is product_22")
Beispiel #6
0
def test_count(collection, bucket, object):
    client = pysonic.Client()
    with client.mode('ingest') as c:
        resp = c.count(collection, bucket)
        print(resp)
Beispiel #7
0
def test_ping():
    client = pysonic.Client()
    with client.mode('search') as c:
        resp = c.ping()
        assert resp