Example #1
0
def setGetCompartmentByIndex(testId):
  print string.ljust ("Check " + testId, rpadding),
  errorFlag = False
  n = rrPython.getNumberOfCompartments()
  for i in range (n):
      value = random.random()*10
      rrPython.setCompartmentByIndex (i, value)
      if expectApproximately(rrPython.getCompartmentByIndex (i), value, 1E-6) == False:
          errorFlag = True
          break;
  print passMsg (errorFlag)
Example #2
0
def checkGetCompartmentIds(testId):
    print string.ljust("Check " + testId, rpadding),
    errorFlag = False
    line = readLine()
    words = line.split()
    expected = rrPython.getCompartmentIds()
    m = rrPython.getNumberOfCompartments()
    for i in range(0, m):
        if words[i] != expected[i]:
            errorFlag = True
            break
    print passMsg(errorFlag)
Example #3
0
def checkGetCompartmentIds (testId):
  print string.ljust ("Check " + testId, rpadding),
  errorFlag = False
  line = readLine ()
  words = line.split()
  expected = rrPython.getCompartmentIds()
  m = rrPython.getNumberOfCompartments()
  for i in range(0,m):
      if words[i] != expected[i]:
             errorFlag = True
             break
  print passMsg (errorFlag)
Example #4
0
import rrPython
import os
import csv

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

function = "getNumberOfCompartments"

try:
    num = rrPython.getNumberOfCompartments()
    if str(num) 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 = 'getNumberOfCompartments'

try:
    num = rrPython.getNumberOfCompartments()
    if str(num) 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()