Current Dir: /snap/core22/2955/usr/share/subiquity/console_conf/controllers/tests/__pycache__/

[FILE] test_chooser.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/share/subiquity/console_conf/controllers/tests/__pycache__/test_chooser.cpython-310.pyc

o

K��^]�@s�ddlZddlmZddlmZddlmZmZddlmZm	Z	dddd	d
dd�d
d	dd�ddd�ddd�gd�Z
ddddddd�dddd�ddd�gd�Zdd�ZGd d!�d!ej
�ZGd"d#�d#ej
�ZdS)$�N)�mock)�make_app)�RecoveryChooserController� RecoveryChooserConfirmController)�RecoverySystemsModel�SelectedSystemActionF�1234zbrand 1zbrand-1z
brand-1-id�	certified)�display-name�username�id�
validationzmodel 1zmodel-1)r
zbrand-id�modelzaction 1�action1)�title�modezaction 2�action2)�current�label�brandr�actionsTzother-labelzbrand 2zbrand-2z
brand-2-id�unprovenzmodel 2zmodel-2cCst�ttg�S)N)r�from_systems�model1_non_current�model2_current�rr�C/usr/share/subiquity/console_conf/controllers/tests/test_chooser.py�
make_modelDs�rc@s.eZdZdd�Zdd�Ze�d�dd��ZdS)	�TestChooserConfirmControllercCsRt�}t|�}tjdd�|_|��|j��|j��|j	�
�|jj�
�dS�N�	selection)r )rrr�Mockr�back�respond�assert_not_called�exit�prev_screen�
assert_called�unselect��self�app�crrr�	test_backKs


z&TestChooserConfirmController.test_backcCs>t�}t|�}tjdd�|_|��|j�d�|j�	�dSr)
rrrr!r�confirmr#�assert_called_withr%r'r)rrr�test_confirmUsz)TestChooserConfirmController.test_confirmz3console_conf.controllers.chooser.ChooserConfirmViewcCsNt�}t|�}t�|_|j�|jjd|jjdjd�|��|��dS)Nr)	rrrr�select�systemsr�make_uir')r*�ccvr+r,rrr�test_confirm_view]s$z.TestChooserConfirmController.test_confirm_viewN)�__name__�
__module__�__qualname__r-r0r�patchr5rrrrrIs

rc@s�eZdZdd�Zejddd�ejddd�dd	���Zejddd�ejddd�d
d���Zejddd�ejddd�dd
���Zejddd�ejddd�dd���Z	dS)�TestChooserControllercCs�tt�d�}t|�}|�|jjd|jjdjd�t|jjd|jjdjdd�}|�|jj	|�|j
��|j�
�|j�
�dS)N�rr)�system�action)rrrr1rr2rr�assertEqualr �next_screenr'r#r$r%)r*r+r,�exprrr�test_selectis"�

z!TestChooserController.test_selectz9console_conf.controllers.chooser.ChooserCurrentSystemViewr)�return_valuez,console_conf.controllers.chooser.ChooserView�allcCsftt�d�}t|�}|j||jjdd�|�||jj�|��}|�|d�|�	�|j
j�d�dS�Nr;T��has_morerrC)rrrr/rrr2r3r>�more_options�ui�set_body�r*�cv�ccsvr+r,�vrrr�test_current_ui_firstvsz+TestChooserController.test_current_ui_firstcCs�tt�d�}t|�}|j||jjdd�|�||jj�|��}|�|d�|�	�|j
j�d�|��|j
j�d�|��|j
j�
�dSrD)rrrr/rrr2r3r>rGrHrIr"�
not_calledrJrrr�'test_current_current_all_there_and_back�sz=TestChooserController.test_current_current_all_there_and_backcCsnt�tg�}t|d�}t|�}|j||jjdd�|�||jj�|�	�}|�
|d�|��|jj
��dS)Nr;FrEr)rrrrrr/rrr2r3r>r"rHrIrO�r*rKrLrr+r,rMrrr�test_only_one_and_current�s
z/TestChooserController.test_only_one_and_currentcCsTt�tg�}t|d�}t|�}|�|jj�|��|�	�|�
�}|�|d�dS)Nr;rC)rrrrr�assertIsNonerrr'r$r3r>rQrrr�!test_all_systems_first_no_current�s
z7TestChooserController.test_all_systems_first_no_currentN)
r6r7r8rArr9rNrPrRrTrrrrr:gs<
��
������r:)�unittestr�subiquitycore.tests.mocksr� console_conf.controllers.chooserrr�console_conf.models.systemsrrrrr�TestCaserr:rrrr�<module>sJ
��������
Upload File: