Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/openstack/tests/unit/cloud/__pycache__/test_update_server.cpython-39.pyc
Ðазад
a u�h � @ sF d Z ddlZddlmZ ddlmZ ddlmZ G dd� dej�Z dS )z_ test_update_server ---------------------------------- Tests for the `update_server` command. � N)�OpenStackCloudException)�fakes)�basec s, e Zd Z� fdd�Zdd� Zdd� Z� ZS )�TestUpdateServerc sJ t t| ��� tt�� �| _| �d�| _| �d�| _ t �| j| j�| _d S )N�nameZname2) �superr �setUp�str�uuid�uuid4� server_idZgetUniqueString�server_name�updated_server_namer �make_fake_server�fake_server��self�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/openstack/tests/unit/cloud/test_update_server.pyr s �zTestUpdateServer.setUpc C s� | � | �� td| jddddgd�d| jgid�td| jddd| jgd�d td d| jiid�d �g� | jt| j j | j| jd� | �� dS )zd Test that an exception in the update raises an exception in update_server. �GET�compute�public�servers�detail��append��method�uri�json�PUTi� �serverr �r! )r r �status_code�validate�r N) � register_uris�get_nova_discovery_mock_dict�dict�get_mock_urlr r r ZassertRaisesr �cloud� update_serverr �assert_callsr r r r �(test_update_server_with_update_exception% s. � ����� �z9TestUpdateServer.test_update_server_with_update_exceptionc C s� t �| j| j�}| �| �� td| jddddgd�d| jgid�td| jddd| jgd�d |itd d | jiid�d�td| jd dddgd�dg id�g� | � | j| j j| j| jd�d � | � � dS )zX Test that update_server updates the name without raising any exception r r r r r r r r"