1
0
Fork 0

Unit tests fixed

master
Pietro 3 years ago
parent b648d52671
commit ad2ad0f9ad
  1. 5
      PyCTBN/tests/structure_graph/test_trajectorygenerator.py

@ -49,13 +49,10 @@ class TestTrajectoryGenerator(unittest.TestCase):
max_trs = [random.randint(5, 100) for i in range(10)] max_trs = [random.randint(5, 100) for i in range(10)]
trajectories = tg.multi_trajectory(max_trs = max_trs) trajectories = tg.multi_trajectory(max_trs = max_trs)
self.assertEqual(len(trajectories), len(max_trs)) self.assertEqual(len(trajectories), len(max_trs))
for i, trajectory in enumerate(trajectories): self.assertTrue({len(trajectory) for trajectory in trajectories} == {max_tr + 1 for max_tr in max_trs})
self.assertEqual(len(trajectory), max_trs[i] + 1)
t_ends = [random.randint(100, 500) for i in range(10)] t_ends = [random.randint(100, 500) for i in range(10)]
trajectories = tg.multi_trajectory(t_ends = t_ends) trajectories = tg.multi_trajectory(t_ends = t_ends)
self.assertEqual(len(trajectories), len(t_ends)) self.assertEqual(len(trajectories), len(t_ends))
for i, trajectory in enumerate(trajectories):
self.assertLessEqual(trajectory.loc[len(trajectory) - 2].at["Time"], t_ends[i])
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()