Skip to content

Commit

Permalink
updated test code
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoli committed Sep 25, 2018
1 parent 86825af commit 92e3210
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CBXML.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Author: Brett G. Olivier
Contact email: [email protected]
Last edit: $Author: bgoli $ ($Id: CBXML.py 660 2018-09-24 14:57:04Z bgoli $)
Last edit: $Author: bgoli $ ($Id: CBXML.py 663 2018-09-25 13:04:39Z bgoli $)
"""
## gets rid of "invalid variable name" info
Expand Down Expand Up @@ -3111,7 +3111,7 @@ def sbml_readSBML3FBC(fname, work_dir=None, return_sbml_model=False, xoptions={}

# check for file read errors
if D.getNumErrors() > 0:
print('***\nDANGER: libSBML reports *{}* read errors, this indicates that this is an invalid SBML file. I will try to load it but cannot guarantee it\'s accuracy.\n***\n'.format(D.getNumErrors()))
print('***\nDANGER: libSBML reports *{}* read errors, this indicates that this is an invalid SBML file. I will try to load it but cannot guarantee its accuracy.\n***\n'.format(D.getNumErrors()))
errors, warnings, others, DOCUMENT_VALID, MODEL_VALID = sbml_validateDocument(D, docread=True)
if not DOCUMENT_VALID:
raise RuntimeError("\nERROR: Validation has detected an invalid SBML document This is a fatal error.\n")
Expand Down
14 changes: 14 additions & 0 deletions src/nosetests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# preparing for Python 3 port
from __future__ import division, print_function
from __future__ import absolute_import
#from __future__ import unicode_literals

import os, nose
import cbmpy

fDir = os.path.split(__file__)[0]
#fDir = os.path.split(fDir)[0]
print('TestBase: ', fDir)

def run():
cDir = os.getcwd()
Expand All @@ -8,4 +17,9 @@ def run():
os.chdir(cDir)
if res:
print('\nAll tests passed.\n')
else:
print('\nPlease ignore the second test failure:\n\n\"ERROR: Failure: ImportError (No module named cbmpy)\"\n\nthis is a known glitch in the testing framework that is currently being worked on.\n')

class TestBase:
def test_import(self):
import cbmpy

0 comments on commit 92e3210

Please sign in to comment.