#NEWLINE# def test_reserved_words_and_batch_scripts( self ) : #NEWLINE# #INDENT# client = pyorient . OrientDB ( 'localhost' , 2424 ) #NEWLINE# client . connect ( 'root' , 'root' ) #NEWLINE# if ( client . _connection . protocol <= 21 ) : #NEWLINE# #INDENT# return unittest . skip ( 'Protocol {!r} does not works well' . format ( client . _connection . protocol ) ) #NEWLINE# #UNINDENT# db_name = 'test_tr' #NEWLINE# try : #NEWLINE# #INDENT# client . db_drop ( db_name ) #NEWLINE# #UNINDENT# except pyorient . PyOrientCommandException as e : #NEWLINE# #INDENT# print ( e ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# db = client . db_create ( db_name , pyorient . DB_TYPE_GRAPH , pyorient . STORAGE_TYPE_MEMORY ) #NEWLINE# #UNINDENT# cluster_info = client . db_open ( db_name , 'admin' , 'admin' , pyorient . DB_TYPE_GRAPH , '' ) #NEWLINE# class_id1 = client . command ( 'create class my_v_class extends V' ) [ 0 ] #NEWLINE# class_id2 = client . command ( 'create class my_e_class extends E' ) [ 0 ] #NEWLINE# rec1 = { #NEWLINE# #INDENT# '@my_v_class' : { #NEWLINE# #INDENT# 'accommodation' : 'house' , #NEWLINE# 'work' : 'office' , #NEWLINE# 'holiday' : 'sea' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# rec2 = { #NEWLINE# #INDENT# '@my_v_class' : { #NEWLINE# #INDENT# 'accommodation' : 'house' , #NEWLINE# 'work2' : 'office' , #NEWLINE# 'holiday' : 'sea3' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# rec_position1 = client . record_create ( class_id1 , rec1 ) #NEWLINE# rec_position2 = client . record_create ( class_id1 , rec2 ) #NEWLINE# sql_edge = ( ( ( 'create edge from ' + rec_position1 . _rid ) + ' to ' ) + rec_position2 . _rid ) #NEWLINE# res = client . command ( sql_edge )