diff options
| author | Ales Kozumplik <akozumpl@redhat.com> | 2011-08-10 10:26:19 +0200 |
|---|---|---|
| committer | Ales Kozumplik <akozumpl@redhat.com> | 2011-08-11 09:24:45 +0200 |
| commit | 2edf05ab6c746cb2271b984132a93bb50ba4db99 (patch) | |
| tree | 5f408895c31365502b98a54fa9c39dd34096d514 /tests | |
| parent | a02c624673fdc3311f64ba270426006b5261c9cb (diff) | |
| download | anaconda-2edf05ab6c746cb2271b984132a93bb50ba4db99.tar.gz anaconda-2edf05ab6c746cb2271b984132a93bb50ba4db99.tar.xz anaconda-2edf05ab6c746cb2271b984132a93bb50ba4db99.zip | |
dispatcher: do not show install steps in upgrade.
This works by unscheduling all the steps that haven't been done, skipped
or requested yet. Correctly remembers the scheduling change so going back
through the upgrade screen and selecting fresh install the next time would
work as expected as far as Dispatcher is concerned.
Unit tests included.
Resolves: rhbz#729558
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pyanaconda_test/dispatch_test.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/pyanaconda_test/dispatch_test.py b/tests/pyanaconda_test/dispatch_test.py index 57de69250..be1026746 100644 --- a/tests/pyanaconda_test/dispatch_test.py +++ b/tests/pyanaconda_test/dispatch_test.py @@ -70,6 +70,18 @@ class StepTest(mock.TestCase): s.schedule(None) self.assertEquals(s.sched, Step.SCHED_SCHEDULED) + def unschedule_test(self): + from pyanaconda.dispatch import Step + from pyanaconda.errors import DispatchError + s = Step("a_step") + s.schedule(None) + self.assertEquals(s.sched, Step.SCHED_SCHEDULED) + s.unschedule(None) + self.assertEquals(s.sched, Step.SCHED_UNSCHEDULED) + s.request(None) + self.assertEquals(s.sched, Step.SCHED_REQUESTED) + self.assertRaises(DispatchError, s.unschedule, None) + def skip_test(self): from pyanaconda.dispatch import Step from pyanaconda.errors import DispatchError @@ -205,3 +217,22 @@ class DispatchTest(mock.TestCase): self.assertEqual(d.steps["filtertype"].sched, Step.SCHED_SCHEDULED) self.assertEqual(d.steps["filter"].sched, Step.SCHED_SCHEDULED) self.assertDictEqual(d.steps[d.step].changes, {}) + + def reset_scheduling_test(self): + from pyanaconda.dispatch import Step + d = self._getDispatcher() + # initial setup + d.schedule_steps("betanag", "filtertype") + d.request_steps("filter") + # in step betanag scheduling gets reset: + d.step = "betanag" + d.reset_scheduling() + # what is requested can not be unrequested: + self.assertEqual(d.steps["betanag"].sched, Step.SCHED_UNSCHEDULED) + self.assertEqual(d.steps["filtertype"].sched, Step.SCHED_UNSCHEDULED) + self.assertEqual(d.steps["filter"].sched, Step.SCHED_REQUESTED) + # make sure the tracking works fine + self.assertEqual( + d.steps["betanag"].changes, + {"betanag" : (Step.SCHED_SCHEDULED, Step.SCHED_UNSCHEDULED), + "filtertype" : (Step.SCHED_SCHEDULED, Step.SCHED_UNSCHEDULED)}) |
