|
|
|
@ -49,13 +49,10 @@ class TestTrajectoryGenerator(unittest.TestCase): |
|
|
|
|
max_trs = [random.randint(5, 100) for i in range(10)] |
|
|
|
|
trajectories = tg.multi_trajectory(max_trs = max_trs) |
|
|
|
|
self.assertEqual(len(trajectories), len(max_trs)) |
|
|
|
|
for i, trajectory in enumerate(trajectories): |
|
|
|
|
self.assertEqual(len(trajectory), max_trs[i] + 1) |
|
|
|
|
self.assertTrue({len(trajectory) for trajectory in trajectories} == {max_tr + 1 for max_tr in max_trs}) |
|
|
|
|
t_ends = [random.randint(100, 500) for i in range(10)] |
|
|
|
|
trajectories = tg.multi_trajectory(t_ends = 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__': |
|
|
|
|
unittest.main() |