def setGetReset(testId): print string.ljust("Check " + testId, rpadding), errorFlag = False values = zeros(rrPython.getNumberOfFloatingSpecies()) for i in range(len(values)): values[i] = random.random() * 10 initial = rrPython.getFloatingSpeciesInitialConcentrations() rrPython.setFloatingSpeciesConcentrations(values) # Should reset the floats by to the current initial condition rrPython.reset() values = rrPython.getFloatingSpeciesConcentrations() if (values != initial).all(): errorFlag = True print passMsg(errorFlag)
def setGetReset(testId): print string.ljust ("Check " + testId, rpadding), errorFlag = False values = zeros (rrPython.getNumberOfFloatingSpecies()) for i in range (len (values)): values[i] = random.random()*10 initial = rrPython.getFloatingSpeciesInitialConcentrations() rrPython.setFloatingSpeciesConcentrations (values) # Should reset the floats by to the current initial condition rrPython.reset() values = rrPython.getFloatingSpeciesConcentrations() if(values != initial).all(): errorFlag = True print passMsg (errorFlag)
import rrPython import os import csv os.chdir('C:\\RoadRunner\\bin') function = 'reset' try: reset = rrPython.reset() if str(reset) 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 = 'reset' try: reset = rrPython.reset() if str(reset) 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()