コード例 #1
0
    def test__power_status_off(self, ipmi_mock):
        ipmicmd = ipmi_mock.return_value
        ipmicmd.get_power.return_value = {'powerstate': 'off'}

        state = ipminative._power_status(self.info)
        ipmicmd.get_power.assert_called_once_with()
        self.assertEqual(states.POWER_OFF, state)
コード例 #2
0
    def test__power_status_error(self, ipmi_mock):
        ipmicmd = ipmi_mock.return_value
        ipmicmd.get_power.return_value = {'powerstate': 'Error'}

        state = ipminative._power_status(self.info)
        ipmicmd.get_power.assert_called_once_with()
        self.assertEqual(states.ERROR, state)
コード例 #3
0
ファイル: test_ipminative.py プロジェクト: mshabdiz/ironic
    def test__power_status_error(self):
        ipmicmd = self.ipmi_mock.return_value
        ipmicmd.get_power.return_value = {'powerstate': 'Error'}

        state = ipminative._power_status(self.info)
        ipmicmd.get_power.assert_called_once_with()
        self.assertEqual(state, states.ERROR)
コード例 #4
0
ファイル: test_ipminative.py プロジェクト: mshabdiz/ironic
    def test__power_status_off(self):
        ipmicmd = self.ipmi_mock.return_value
        ipmicmd.get_power.return_value = {'powerstate': 'off'}

        state = ipminative._power_status(self.info)
        ipmicmd.get_power.assert_called_once_with()
        self.assertEqual(state, states.POWER_OFF)
コード例 #5
0
ファイル: test_ipminative.py プロジェクト: home-dog/ironic
    def test__power_status_error(self):
        ipmicmd = self.ipmi_mock.return_value
        ipmicmd.get_power.return_value = {"powerstate": "Error"}

        state = ipminative._power_status(self.info)
        ipmicmd.get_power.assert_called_once_with()
        self.assertEqual(state, states.ERROR)
コード例 #6
0
ファイル: test_ipminative.py プロジェクト: home-dog/ironic
    def test__power_status_off(self):
        ipmicmd = self.ipmi_mock.return_value
        ipmicmd.get_power.return_value = {"powerstate": "off"}

        state = ipminative._power_status(self.info)
        ipmicmd.get_power.assert_called_once_with()
        self.assertEqual(state, states.POWER_OFF)
コード例 #7
0
 def test__power_status(self):
     state = ipminative._power_status(self.info).strip().split()[-1]
     target_state = ipminative._power_status(self.info).strip().split()[-1]
     print target_state
     self.assertEqual(target_state, state)