#NEWLINE# def testLinkList( self ) : #NEWLINE# #INDENT# DB = pyorient . OrientDB ( 'localhost' , 2424 ) #NEWLINE# DB . connect ( 'root' , 'root' ) #NEWLINE# db_name = 'test_tr' #NEWLINE# try : #NEWLINE# #INDENT# DB . db_drop ( db_name ) #NEWLINE# #UNINDENT# except pyorient . PyOrientCommandException as e : #NEWLINE# #INDENT# print ( e ) #NEWLINE# pass #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# db = DB . db_create ( e , pyorient . DB_TYPE_GRAPH , pyorient . STORAGE_TYPE_MEMORY ) #NEWLINE# pass #NEWLINE# #UNINDENT# DB . command ( "insert into V set key1 = 'row0'" ) #NEWLINE# DB . command ( "insert into V set key1 = 'row1'" ) #NEWLINE# DB . command ( "insert into V set key1 = 'row2'" ) #NEWLINE# DB . command ( "insert into V set key1 = 'row3'" ) #NEWLINE# o1 = pyorient . OrientRecordLink ( '9:0' ) #NEWLINE# o2 = pyorient . OrientRecordLink ( '9:1' ) #NEWLINE# o3 = pyorient . OrientRecordLink ( '9:2' ) #NEWLINE# o4 = pyorient . OrientRecordLink ( '9:3' ) #NEWLINE# lList = [ o1 , o2 , o3 , o4 ] #NEWLINE# rec = DB . record_create ( 9 , { #NEWLINE# #INDENT# 'test' : lList , #NEWLINE# 'key1' : 'row4' , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( self . client . version . major > 1 ) : #NEWLINE# #INDENT# _rec = DB . record_load ( '#9:4' ) #NEWLINE# assert ( len ( _rec . oRecordData [ 'test' ] ) == 4 ) #NEWLINE# assert isinstance ( _rec . oRecordData [ 'test' ] [ 0 ] , pyorient . OrientRecordLink )