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