Example #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)
Example #2
0
def test_flushb():
    client = pysonic.Client()
    with client.mode('ingest') as c:
        resp = c.flushb("test", "test")
        assert resp == ['product_1']
Example #3
0
def test_suggest(collection, bucket):
    client = pysonic.Client()
    with client.mode('search') as c:
        assert c.suggest(collection, bucket, "engli") == ['english']
Example #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]
Example #5
0
def test_ingest():
    client = pysonic.Client()
    with client.mode('ingest') as c:
        c.push("test", "test", "product 22", "this is product_22")
Example #6
0
def test_count(collection, bucket, object):
    client = pysonic.Client()
    with client.mode('ingest') as c:
        resp = c.count(collection, bucket)
        print(resp)
Example #7
0
def test_ping():
    client = pysonic.Client()
    with client.mode('search') as c:
        resp = c.ping()
        assert resp