def test_power(self):
        ret = {'name': 'power_on',
               'result': True,
               'comment': '',
               'changes': {}}

        mock = MagicMock(return_value='on')
        with patch.dict(ipmi.__salt__, {'ipmi.get_power': mock,
                                        'ipmi.set_power': mock}):
            comt = ('system already in this state')
            ret.update({'comment': comt})
            self.assertDictEqual(ipmi.power(), ret)

            with patch.dict(ipmi.__opts__, {'test': False}):
                comt = ('changed system power')
                ret.update({'name': 'off', 'comment': comt, 'result': True,
                            'changes': {'new': 'off', 'old': 'on'}})
                self.assertDictEqual(ipmi.power('off'), ret)

            with patch.dict(ipmi.__opts__, {'test': True}):
                comt = ('would power: off system')
                ret.update({'comment': comt, 'result': None})
                self.assertDictEqual(ipmi.power('off'), ret)

    # 'user_present' function tests: 1
Returns text of the message.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/ipmi_test.py/IpmiTestCase.test_power--crossover with--dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/xmpp/protocol.py/Message.getBody