def setGetTimeCourseSelectionList(testId): print string.ljust("Check " + testId, rpadding), errorFlag = False myList = rrPython.getFloatingSpeciesIds() newList = list(myList) random.shuffle(newList) rrPython.setTimeCourseSelectionList(newList) if rrPython.getTimeCourseSelectionList() != newList: errorFlag = True print passMsg(errorFlag)
def setGetTimeCourseSelectionList(testId): print string.ljust ("Check " + testId, rpadding), errorFlag = False myList = rrPython.getFloatingSpeciesIds() newList = list (myList) random.shuffle (newList) rrPython.setTimeCourseSelectionList (newList) if rrPython.getTimeCourseSelectionList() != newList: errorFlag = True print passMsg (errorFlag)
def setGetSteadyStateSelectionList(testId): print string.ljust("Check " + testId, rpadding), errorFlag = False myList = rrPython.getFloatingSpeciesIds() newList = list(myList) while newList == myList: random.shuffle(newList) rrPython.setSteadyStateSelectionList(newList) getList = rrPython.getSteadyStateSelectionList() if getList != newList: errorFlag = True print passMsg(errorFlag)
def checkGetFloatingSpeciesIds(testId): print string.ljust("Check " + testId, rpadding), errorFlag = False line = readLine() words = line.split() expected = rrPython.getFloatingSpeciesIds() m = rrPython.getNumberOfFloatingSpecies() for i in range(0, m): if words[i] != expected[i]: errorFlag = True break print passMsg(errorFlag)
def setGetSteadyStateSelectionList(testId): print string.ljust ("Check " + testId, rpadding), errorFlag = False myList = rrPython.getFloatingSpeciesIds() newList = list (myList) while newList == myList: random.shuffle (newList) rrPython.setSteadyStateSelectionList (newList) getList = rrPython.getSteadyStateSelectionList() if getList != newList: errorFlag = True print passMsg (errorFlag)
def checkGetFloatingSpeciesIds(testId): print string.ljust ("Check " + testId, rpadding), errorFlag = False line = readLine () words = line.split() expected = rrPython.getFloatingSpeciesIds() m = rrPython.getNumberOfFloatingSpecies() for i in range(0,m): if words[i] != expected[i]: errorFlag = True break print passMsg (errorFlag)
def scriptTests(): print print "Testing Set and Get Functions" print "-----------------------------" setGetValues(rrPython.getFloatingSpeciesIds(), 'Set/Get Value (Floats)') setGetValues(rrPython.getBoundarySpeciesIds(), 'Set/Get Value (Boundary)') setGetValues(rrPython.getGlobalParameterIds(), 'Set/Get Value (Global Parameters)') setGetValues(rrPython.getCompartmentIds(), 'Set/Get Value (Compartments)') setGetTimeStart('Set/Get TimeStart') setGetTimeEnd ('Set/Get TimeEnd') setGetNumberOfPoints ('Set/Get Number Of Points') setGetTimeCourseSelectionList ('Set/Get Time Course Selection List') setGetSteadyStateSelectionList ('Set/Get Steady State Selection List') setGetFloatingSpeciesByIndex ('Set/Get Floating Species by Index') setGetBoundarySpeciesByIndex ('Set/Get Boundary Species by Index') setGetCompartmentByIndex ('Set/Get Compartment by Index') setGetGlobalParameterByIndex ('Set/Get Global Parameter buy Index') setGetBoundarySpeciesConcentrations ('Set/Get Boundary Species Concs') setGetFloatingSpeciesConcentrations ('Set/Get Floating Species Concs') setGetInitialFloatingSpeciesConcentrations ('Set/Get Initial Concs') setGetReset ('Set/Get Reset Method')
import rrPython import os import csv os.chdir('C:\\RoadRunner\\bin') function = 'getFloatingSpeciesIds' try: names = rrPython.getFloatingSpeciesIds() if str(names) is not False: result = 'True' else: result = 'False' except: result = 'False' PythonTestResults = open('C:\\RoadRunner\\PythonTestResults.csv','a') writer = csv.writer(PythonTestResults) writevar = function + '=' + result writer.writerow([writevar]) PythonTestResults.close()
import rrPython import os import csv os.chdir('C:\\RoadRunner\\bin') function = 'getFloatingSpeciesIds' try: names = rrPython.getFloatingSpeciesIds() if str(names) is not False: result = 'True' else: result = 'False' except: result = 'False' PythonTestResults = open('C:\\RoadRunner\\PythonTestResults.csv', 'a') writer = csv.writer(PythonTestResults) writevar = function + '=' + result writer.writerow([writevar]) PythonTestResults.close()