Esempio n. 1
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)
Esempio n. 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)
Esempio n. 3
0
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 = 'getCompartmentIds'

try:
    names = rrPython.getCompartmentIds()
    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 = 'getCompartmentIds'

try:
    names = rrPython.getCompartmentIds()
    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()