Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
* Improved "TestStatelessCrosser" (2). #58
Browse files Browse the repository at this point in the history
  • Loading branch information
garciparedes committed Oct 26, 2019
1 parent 4df946e commit 933d0e5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_algorithms/test_utils/test_crossers/test_stateless.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ def test_creation(self):
self.assertEqual(fleet, dispatcher.fleet)
self.assertEqual(len(job.trips), len(list(dispatcher.iterator)))

def test_flush(self):
job = jit.Job(generate_trips(10), objective_cls=jit.DialARideObjective)
fleet = jit.Fleet(generate_vehicles(10))
dispatcher = jit.StatelessCrosser(
job=job,
fleet=fleet,
)
self.assertNotIn('iterator', dispatcher.__dict__)
list(dispatcher.iterator)
self.assertIn('iterator', dispatcher.__dict__)
dispatcher.flush()
self.assertNotIn('iterator', dispatcher.__dict__)


if __name__ == '__main__':
unittest.main()

0 comments on commit 933d0e5

Please sign in to comment.