def testLinkJobOutput2Data( self ):
     Transaction.create( self.sessionPath , False , True )
     transaction = Transaction( self.sessionPath , Transaction.WRITE )
     sendData = self.datas[0]
     transaction.createData( sendData[ 'dataName' ] ,
                             sendData[ 'userName' ] ,
                             sendData[ 'size' ] ,
                             sendData[ 'Type' ] ,
                             sendData[ 'dataBegin' ] ,
                             sendData[ 'inputModes' ] ,
                             producedBy = [] ,
                             usedBy = []
                             )
     sendJob = self.jobs[ 0 ]
     transaction.createJob( sendJob['jobID'] ,
                             sendJob['userName'] ,
                             sendJob['programName'] ,
                             sendJob['status'] ,
                             sendJob['date'] ,
                             [] ,
                             []
                             )
     transaction.commit()
     transaction = Transaction( self.sessionPath , Transaction.WRITE )
     transaction.linkJobOutput2Data( [ sendData[ 'dataName' ] ] , [ sendJob['jobID'] ])
     transaction.commit()
     transaction = Transaction( self.sessionPath , Transaction.READ )
     data = transaction.getData( sendData[ 'dataName' ] )
     job = transaction.getJob( sendJob['jobID'])
     transaction.commit()
     self.assertEqual( data[ 'producedBy' ][0] , sendJob[ 'jobID' ] )
     self.assertEqual( job[ 'dataProduced' ][0] , sendData[ 'dataName' ] )
 def testCreateAndGetJob( self ):
     Transaction.create( self.sessionPath , False , True )
     sendJob = self.jobs[ 1 ]
     transaction = Transaction( self.sessionPath , Transaction.WRITE )
     transaction.createJob( sendJob['jobID'] ,
                             sendJob['userName'] ,
                             sendJob['programName'] ,
                             sendJob['status'] ,
                             sendJob['date'] ,
                             sendJob['dataUsed'] ,
                             sendJob['dataProduced']
                             )
     transaction.commit()
     transaction = Transaction( self.sessionPath , Transaction.READ )
     receivedJob = transaction.getJob( sendJob[ 'jobID' ] )
     transaction.commit()
     self.assertEqual( sendJob , receivedJob )