Ejemplo n.º 1
0
def setGetFloatingSpeciesByIndex(testId):
  print string.ljust ("Check " + testId, rpadding),
  errorFlag = False
  n = rrPython.getNumberOfFloatingSpecies()
  for i in range (n):
      value = random.random()*10
      rrPython.setFloatingSpeciesByIndex (i, value)
      if expectApproximately(rrPython.getFloatingSpeciesByIndex (i), value, 1E-6) == False:
          errorFlag = True
          break;
  print passMsg (errorFlag)
import rrPython
import os
import csv
os.chdir('C:\\RoadRunner\\bin')

function = 'setFloatingSpeciesByIndex'
rrPython.loadSBMLFromFile('C:\\RoadRunner\\Models\\feedback.xml')

index = 0
value = 1.0
try:
    specs = rrPython.setFloatingSpeciesByIndex(index, value)
    if str(specs) 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()
Ejemplo n.º 3
0
import rrPython
import os
import csv

os.chdir("C:\\RoadRunner\\bin")

function = "setFloatingSpeciesByIndex"
rrPython.loadSBMLFromFile("C:\\RoadRunner\\Models\\feedback.xml")

index = 0
value = 1.0
try:
    specs = rrPython.setFloatingSpeciesByIndex(index, value)
    if str(specs) 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()