Пример #1
0
 def test_power_cycle_not_installed(self, zboot, rack):
     instance = ZerobootRacktivityHost(name="test", data=self._valid_data)
     with pytest.raises(
             StateCheckError,
             message=
             "power_cycle should be not be able to be called before install"
     ):
         instance.power_cycle()
Пример #2
0
    def test_power_cycle(self, zboot, rack):
        instance = ZerobootRacktivityHost(name="test", data=self._valid_data)
        instance.state.set('actions', 'install', 'ok')
        rack.get = MagicMock()

        instance.power_cycle()

        expected_calls = []
        for d in reversed(self._valid_data['racktivities']):
            expected_calls.append(zboot.get().port_power_cycle(
                d['port'], mock.ANY, d['powermodule']))