def test_power_cycle_not_installed(self, zboot, ipmi):
     instance = ZerobootIpmiHost(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()
    def test_power_cycle(self, zboot, ipmi):
        instance = ZerobootIpmiHost(name="test", data=self._valid_data)
        instance.state.set('actions', 'install', 'ok')

        instance.power_cycle()
        ipmi.get().power_cycle.assert_called_with()