Skip to content

Commit

Permalink
Add experiment prepare and finish tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tfarago committed Aug 11, 2014
1 parent c9aea58 commit ca5863a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion concert/tests/integration/test_experiments.py
Expand Up @@ -10,7 +10,7 @@
tomo_angular_step, tomo_max_speed,
tomo_projections_number, frames)
from concert.devices.cameras.dummy import Camera
from concert.tests import TestCase, suppressed_logging, assert_almost_equal
from concert.tests import TestCase, suppressed_logging, assert_almost_equal, VisitChecker
from concert.tests.unit.test_walker import DummyWalker, compute_path


Expand Down Expand Up @@ -77,6 +77,7 @@ class TestExperiment(TestExperimentBase):
def setUp(self):
super(TestExperiment, self).setUp()
self.experiment = Experiment(self.acquisitions, self.walker, name_fmt=self.name_fmt)
self.visit_checker = VisitChecker()

def test_run(self):
self.experiment.run().join()
Expand Down Expand Up @@ -113,6 +114,16 @@ def test_remove(self):
self.assertFalse(hasattr(self.experiment, 'bar'))
self.assertNotIn(self.bar, self.experiment.acquisitions)

def test_prepare(self):
self.experiment.prepare = self.visit_checker.visit
self.experiment.run().join()
self.assertTrue(self.visit_checker.visited)

def test_finish(self):
self.experiment.finish = self.visit_checker.visit
self.experiment.run().join()
self.assertTrue(self.visit_checker.visited)


class TestImagingExperiment(TestExperimentBase):

Expand Down

0 comments on commit ca5863a

Please sign in to comment.