Exemplo n.º 1
0
 def test_set_stage_first(self, gv, sv):
     gv.return_value = None
     stage.set_stage(1)
     sv.assert_has_calls([
         mock.call('Start', mock.ANY, 'HKLM', stage.STAGES_ROOT + r'\1'),
         mock.call('_Active', '1', 'HKLM', stage.STAGES_ROOT)
     ])
Exemplo n.º 2
0
 def Run(self):
   try:
     stage.set_stage(int(self._args[0]))
     # Terminal stages exit immediately; the build should be complete.
     if len(self._args) > 1 and self._args[1]:
       stage.exit_stage(int(self._args[0]))
   except stage.Error as e:
     raise ActionError(str(e))
Exemplo n.º 3
0
 def test_set_stage_first(self, reg, get_active):
     get_active.return_value = None
     stage.set_stage(1)
     reg.assert_called_with('HKLM')
     reg.return_value.SetKeyValue.assert_has_calls([
         mock.call(key_path=stage.STAGES_ROOT + r'\1',
                   key_name='Start',
                   key_value=mock.ANY,
                   key_type='REG_SZ',
                   use_64bit=True),
         mock.call(key_path=stage.STAGES_ROOT,
                   key_name='_Active',
                   key_value='1',
                   key_type='REG_SZ',
                   use_64bit=True)
     ])
Exemplo n.º 4
0
 def test_set_stage_next(self, unused_reg, get_active, exit_stage):
     get_active.return_value = '1'
     stage.set_stage(2)
     exit_stage.assert_called_with('1')
Exemplo n.º 5
0
 def test_set_stage_next(self, reg, get_active, exit_stage):
     get_active.return_value = 1
     stage.set_stage(2)
     exit_stage.assert_called_with(1)
     reg.assert_called_with('_Active', '2', 'HKLM', stage.STAGES_ROOT)
Exemplo n.º 6
0
 def Run(self):
     try:
         stage.set_stage(int(self._args[0]))
     except stage.Error as e:
         raise ActionError(str(e))