Skip to content

Commit

Permalink
Python support: check for the validity and issues of a simulation file (
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Dec 9, 2019
1 parent daa172b commit 9148ea7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/plugins/support/PythonSupport/tests/data/tests.out
Expand Up @@ -14,6 +14,9 @@ OSError("'https://unknown' could not be opened (host unknown not found).")
Local CellML file
---------------------------------------
- Open file...
- Check file...
- Valid: YES
- Issues: N/A
- Run file...
- Retrieve simulation results...
- Retrieve states...
Expand All @@ -23,6 +26,9 @@ OSError("'https://unknown' could not be opened (host unknown not found).")
Remote CellML file
---------------------------------------
- Open file...
- Check file...
- Valid: YES
- Issues: N/A
- Run file...
- Retrieve simulation results...
- Retrieve states...
Expand All @@ -32,6 +38,9 @@ OSError("'https://unknown' could not be opened (host unknown not found).")
Local SED-ML file
---------------------------------------
- Open file...
- Check file...
- Valid: YES
- Issues: N/A
- Run file...
- Retrieve simulation results...
- Retrieve states...
Expand All @@ -41,6 +50,9 @@ OSError("'https://unknown' could not be opened (host unknown not found).")
Remote SED-ML file
---------------------------------------
- Open file...
- Check file...
- Valid: YES
- Issues: N/A
- Run file...
- Retrieve simulation results...
- Retrieve states...
Expand All @@ -50,6 +62,9 @@ OSError("'https://unknown' could not be opened (host unknown not found).")
Local COMBINE archive
---------------------------------------
- Open file...
- Check file...
- Valid: YES
- Issues: N/A
- Run file...
- Retrieve simulation results...
- Retrieve states...
Expand All @@ -59,6 +74,9 @@ OSError("'https://unknown' could not be opened (host unknown not found).")
Remote COMBINE archive
---------------------------------------
- Open file...
- Check file...
- Valid: YES
- Issues: N/A
- Run file...
- Retrieve simulation results...
- Retrieve states...
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/support/PythonSupport/tests/data/tests.py
Expand Up @@ -19,6 +19,16 @@ def run_simulation(title: str, file_name_or_url: str, first: bool = True) -> obj
simulation = oc.open_simulation(
os.path.dirname(__file__) + '/../../../../../../models/tests/' + file_name_or_url)

print(' - Check file...')
print(' - Valid: ' + ('YES' if simulation.valid() else 'NO'))

issues = simulation.issues()

if issues:
print(' - Issues:\n - ' + '\n - '.join(simulation.issues()))
else:
print(' - Issues: N/A')

print(' - Run file...')

simulation.run()
Expand Down

0 comments on commit 9148ea7

Please sign in to comment.