Skip to content

Commit

Permalink
Add unit test for catching error termination
Browse files Browse the repository at this point in the history
  • Loading branch information
Hao-Wei Pang committed Nov 4, 2019
1 parent 75eff06 commit d22604d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arkane/gaussianTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

from arkane.gaussian import GaussianLog
from arkane.statmech import determine_qm_software
from arkane.exceptions import LogError

################################################################################

Expand Down Expand Up @@ -163,6 +164,16 @@ def test_determine_qm_software(self):
log = determine_qm_software(os.path.join(os.path.dirname(__file__), 'data', 'oxygen.log'))
self.assertIsInstance(log, GaussianLog)

def test_gaussian_log_error_termination(self):
"""
Ensures that error termination gaussian log file raises an logError
"""
file_path = os.path.join(os.path.dirname(__file__), 'data', 'error_termination.out')
log = GaussianLog(file_path)
with self.assertRaises(LogError) as log_error:
log.load_conformer()
self.assertTrue(f'The Gaussian job in {file_path} did not converge.' in str(log_error.exception))


################################################################################

Expand Down

0 comments on commit d22604d

Please sign in to comment.