python-dracclient/dracclient/tests/test_lifecycle_controller.py

39 lines
1.4 KiB
Python

#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import requests_mock
import dracclient.client
from dracclient.resources import uris
from dracclient.tests import base
from dracclient.tests import utils as test_utils
class ClientLifecycleControllerManagementTestCase(base.BaseTest):
def setUp(self):
super(ClientLifecycleControllerManagementTestCase, self).setUp()
self.drac_client = dracclient.client.DRACClient(
**test_utils.FAKE_ENDPOINT)
@requests_mock.Mocker()
def test_get_lifecycle_controller_version(self, mock_requests):
mock_requests.post(
'https://1.2.3.4:443/wsman',
text=test_utils.LifecycleControllerEnumerations[
uris.DCIM_SystemView]['ok'])
version = self.drac_client.get_lifecycle_controller_version()
self.assertEqual((2, 1, 0), version)