desc: Tests syncing tables tests: # Set up our test tables - cd: r.db('test').table_create('test1') ot: partial({'tables_created':1}) - cd: r.db('test').table_create('test1soft') ot: partial({'tables_created':1}) - cd: r.db('test').table('test1soft').config().update({'durability':'soft'}) ot: {'skipped':0, 'deleted':0, 'unchanged':0, 'errors':0, 'replaced':1, 'inserted':0} - def: tbl = r.db('test').table('test1') - def: tbl_soft = r.db('test').table('test1soft') - cd: tbl.index_create('x') ot: partial({'created':1}) - cd: tbl.index_wait('x').pluck('index', 'ready') ot: [{'ready':True, 'index':'x'}] # This is the only way one can use sync legally at the moment - cd: tbl.sync() ot: {'synced':1} - cd: tbl_soft.sync() ot: {'synced':1} - cd: tbl.sync() ot: {'synced':1} runopts: durability: "soft" - cd: tbl.sync() ot: {'synced':1} runopts: durability: "hard" # This is of type table, but sync should still fail (because it makes little sense) - cd: tbl.between(1, 2).sync() ot: cd: err('ReqlQueryLogicError', 'Expected type TABLE but found TABLE_SLICE:', [1]) py: err('AttributeError', "'Between' object has no attribute 'sync'") # These are not even a table. Sync should fail with a different error message - cd: r.expr(1).sync() ot: cd: err("ReqlQueryLogicError", 'Expected type TABLE but found DATUM:', [1]) py: err('AttributeError', "'Datum' object has no attribute 'sync'") - js: tbl.order_by({index:'x'}).sync() rb: tbl.order_by({:index => 'soft'}).sync() ot: err("ReqlQueryLogicError", 'Expected type TABLE but found TABLE_SLICE:', [1]) # clean up - cd: r.db('test').table_drop('test1') ot: partial({'tables_dropped':1}) - cd: r.db('test').table_drop('test1soft') ot: partial({'tables_dropped':1})