コード例 #1
0
ファイル: test_power.py プロジェクト: larainema/ironic
    def test__get_power_state(self, get_ilo_object_mock):
        ilo_mock_object = get_ilo_object_mock.return_value
        ilo_mock_object.get_host_power_status.return_value = "ON"

        self.assertEqual(states.POWER_ON, ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = "OFF"
        self.assertEqual(states.POWER_OFF, ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = "ERROR"
        self.assertEqual(states.ERROR, ilo_power._get_power_state(self.node))
コード例 #2
0
ファイル: test_power.py プロジェクト: hongbin/ironic
    def test__get_power_state(self, power_ilo_client_mock, common_ilo_client_mock):
        ilo_mock_object = common_ilo_client_mock.IloClient.return_value
        ilo_mock_object.get_host_power_status.return_value = "ON"

        self.assertEqual(states.POWER_ON, ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = "OFF"
        self.assertEqual(states.POWER_OFF, ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = "ERROR"
        self.assertEqual(states.ERROR, ilo_power._get_power_state(self.node))
コード例 #3
0
    def test__get_power_state(self, get_ilo_object_mock):
        ilo_mock_object = get_ilo_object_mock.return_value
        ilo_mock_object.get_host_power_status.return_value = 'ON'

        self.assertEqual(states.POWER_ON,
                         ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = 'OFF'
        self.assertEqual(states.POWER_OFF,
                         ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = 'ERROR'
        self.assertEqual(states.ERROR, ilo_power._get_power_state(self.node))
コード例 #4
0
    def test__get_power_state(self, power_ilo_client_mock,
                              common_ilo_client_mock):
        ilo_mock_object = common_ilo_client_mock.IloClient.return_value
        ilo_mock_object.get_host_power_status.return_value = 'ON'

        self.assertEqual(states.POWER_ON,
                         ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = 'OFF'
        self.assertEqual(states.POWER_OFF,
                         ilo_power._get_power_state(self.node))

        ilo_mock_object.get_host_power_status.return_value = 'ERROR'
        self.assertEqual(states.ERROR, ilo_power._get_power_state(self.node))