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))
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))
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))
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))