import couchbase HOST='localhost' BUCKET='beer-sample' DESIGN='b' VIEW1='stream_test1' # value present VIEW2='stream_test2' # no value present # begin by running with couchbase view with no value (null) and streaming set to false cb = couchbase.Couchbase.connect(host=HOST, bucket=BUCKET) query2 = cb.query(view=VIEW2, design=DESIGN, streaming=False) for q in query2: pass print 'test 1 went ok' # then try with value. streaming again set to false query1 = cb.query(view=VIEW1, design=DESIGN, streaming=False) for q in query1: pass print 'test 2 went ok' # begin by running with couchbase view with no value (null) and streaming set to true cb = couchbase.Couchbase.connect(host=HOST, bucket=BUCKET) query2 = cb.query(view=VIEW2, design=DESIGN, streaming=True) for q in query2: pass print 'test 3 went ok' print 'time to fail...' # then try with value. will bail out query1 = cb.query(view=VIEW1, design=DESIGN, streaming=True) for q in query1: pass