Skip to content

Commit

Permalink
fixup! Add some unit tests for KineticsModel class.
Browse files Browse the repository at this point in the history
  • Loading branch information
mliu49 committed Sep 27, 2019
1 parent ce7c05c commit e69ee62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rmgpy/kinetics/modelTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ def test_repr(self):
Test that an KineticsModel object can be reconstructed from its repr()
output with no loss of information.
"""
km = None
exec('km = {0!r}'.format(self.km))
namespace = {}
exec('km = {0!r}'.format(self.km), globals(), namespace)
self.assertIn('km', namespace)
km = namespace['km']
self.assertTrue(self.km.is_identical_to(km))
self.assertEqual(dir(self.km), dir(km))
for att in 'Tmax Tmin Pmax Pmin comment uncertainty'.split():
Expand All @@ -98,7 +100,7 @@ def test_pickle(self):
"""
import pickle
km = pickle.loads(pickle.dumps(self.km,-1))
self.assertTrue(self.km.isIdenticalTo(km))
self.assertTrue(self.km.is_identical_to(km))
self.assertEqual(dir(self.km), dir(km))
for att in 'Tmax Tmin Pmax Pmin comment uncertainty'.split():
self.assertEqual(repr(getattr(self.km, att)), repr(getattr(km, att)))
Expand Down

0 comments on commit e69ee62

Please sign in to comment.