-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from connie/master
Change input file's behavior of loading families through `kineticFamilies` field, and various fixes. There's a lot more error checking now, and the error checking is tested in a unit test!
- Loading branch information
Showing
4 changed files
with
104 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import unittest | ||
from external.wip import work_in_progress | ||
|
||
from rmgpy import settings | ||
from rmgpy.data.kinetics import * | ||
from rmgpy.data.base import DatabaseError | ||
################################################### | ||
|
||
class TestKineticsDatabase(unittest.TestCase): | ||
|
||
def testLoadFamilies(self): | ||
""" | ||
Test that the loadFamilies function raises the correct exceptions | ||
""" | ||
path = os.path.join(settings['database.directory'],'kinetics','families') | ||
database = KineticsDatabase() | ||
|
||
with self.assertRaises(DatabaseError): | ||
database.loadFamilies(path, families='random') | ||
with self.assertRaises(DatabaseError): | ||
database.loadFamilies(path, families=['!H_Abstraction','Disproportionation']) | ||
with self.assertRaises(DatabaseError): | ||
database.loadFamilies(path, families=['fake_family']) | ||
with self.assertRaises(DatabaseError): | ||
database.loadFamilies(path, families=[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters