Skip to content

Commit

Permalink
finish coverage testing of Perturbation()
Browse files Browse the repository at this point in the history
  • Loading branch information
artgoldberg committed Apr 8, 2020
1 parent 46ca803 commit 3934641
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_sim_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,26 @@ def test_get_num_time_steps(self):
self.assertEqual(cfg.get_num_time_steps(), 5)


class TestPerturbation(unittest.TestCase):

def test_perturbation(self):
change = Change([['species', {'id': 'species_1[compartment_1]'}],
'distribution_init_concentration',
'mean',
], 4)
perturbation_0 = Perturbation(change, start_time=2, end_time=10)
perturbation_1 = Perturbation(change, start_time=0, end_time=10)
perturbation_2 = Perturbation(change, start_time=0, end_time=float('nan'))
perturbation_3 = Perturbation(change, start_time=0, end_time=11)
self.assertNotEqual(perturbation_1, 7)
self.assertNotEqual(perturbation_0, perturbation_1)
self.assertNotEqual(perturbation_1, perturbation_2)
self.assertNotEqual(perturbation_2, perturbation_1)
self.assertNotEqual(perturbation_1, perturbation_3)
self.assertEqual(perturbation_1, perturbation_1)
self.assertEqual(perturbation_2, perturbation_2)


class TestSedMlImportExport(unittest.TestCase):

def setUp(self):
Expand Down

0 comments on commit 3934641

Please sign in to comment.