Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_turtle.cpython-312.opt-1.pyc

�

'Μg'8���ddlZddlZddlmZddlmZddlmZejd�ZejZ	dZ
dZdZGd	�d
ej�ZGd�d�ZGd
�d�ZGd�deej�ZGd�deej�ZGd�dej�ZGd�dej�Zedk(rej,�yy)�N)�support)�
import_helper)�	os_helper�turtlea_width = 0.75
height = 0.8
canvwidth = 500
canvheight = 200
leftright = 100
topbottom = 100
mode = world
colormode = 255
delay = 100
undobuffersize = 10000
shape = circle
pencolor  = red
fillcolor  = blue
resizemode  = auto
visible  = None
language = english
exampleturtle = turtle
examplescreen = screen
title = Python Turtle Graphics
using_IDLE = ''
z�# Comments!
# Testing comments!
pencolor  = red
fillcolor  = blue
visible  = False
language = english
# Some more
# comments
using_IDLE = False
z0
pencolor = red
fillcolor: blue
visible = False
c�$�eZdZd�Zd�Zd�Zd�Zy)�TurtleConfigTestc��|jtjtj�t	tjd�5}|j|�ddd�tjS#1swYtjSxYw)N�w)�
addCleanupr�unlink�TESTFN�open�write)�self�cfg_str�fs   �-/usr/local/lib/python3.12/test/test_turtle.py�get_cfg_filezTurtleConfigTest.get_cfg_file7s]�����	�(�(�)�*:�*:�;�
�)�"�"�C�
(�A�
�G�G�G��)�����)�����s�	A3�3Bc���|jt�}tj|�}idd�dd�dd�dd�d	d
�dd
�dd
�dd�dd
�dd�dd�dd�dd�dd�dd�dd�dd�d d!d"d#��}|j	||�y)$N�widthg�?�heightg�������?�	canvwidth���
canvheight���	leftright�d�	topbottom�mode�world�	colormode��delay�undobuffersize�'�shape�circle�pencolor�red�	fillcolor�blue�
resizemode�auto�visible�language�english�
exampleturtler�screenzPython Turtle Graphics�)�
examplescreen�title�
using_IDLE)r�test_configr�config_dict�assertEqual�r�cfg_name�
parsed_cfg�expecteds    r�test_config_dictz!TurtleConfigTest.test_config_dict=s���$�$�[�1���'�'��1�
�
��d�
��s�
�
�#�
�
�#�	
�

��
�
��

�
�G�
�
��
�
�S�
�
�e�
�
�X�
�
��
�
�&�
�
�6�
�
��
� 
�	�!
�"
�X�#
�$&�-��)
��.	
����X�.�c��|jt�}tj|�}dddddd�}|j	||�y)Nr)r+Fr0)r(r*r.r/r6)r�test_config_tworr8r9r:s    r�&test_partial_config_dict_with_commentsz7TurtleConfigTest.test_partial_config_dict_with_comments[sL���$�$�_�5���'�'��1�
����!��
��	
����X�.r?c�<�|jt�}tj�5}tj|�}ddd�j
�}|jd|�|jd|�|jddd��y#1swY�SxYw)NzBad line in config-file zfillcolor: bluer)F)r(r.)	r�invalid_test_configr�captured_stdoutrr8�getvalue�assertInr9)rr;�stdoutr<�err_msgs     r�test_config_dict_invalidz)TurtleConfigTest.test_config_dict_invalidjs����$�$�%8�9��
�
$�
$�
&�&��+�+�H�5�J�'��/�/�#���
�
�0�'�:��
�
�'��1�������&
�	�'�
&�s�B�BN)�__name__�
__module__�__qualname__rr>rBrJ�r?rrr5s�� �/�<
/�r?rc��eZdZd�Zy)�VectorComparisonMixinc���t|�t|�k7r|jd�tt||��D]+\}\}}|j	||dj|����-y)NzTuples are not of equal sizezvalues at index {} do not match)�msg)�len�fail�	enumerate�zip�assertAlmostEqual�format)r�vec1�vec2�idx�i�js      r�assertVectorsAlmostEqualz.VectorComparisonMixin.assertVectorsAlmostEqual~sc���t�9��D�	�!��I�I�4�5�$�S��t�_�5�K�C��!�Q��"�"��1�;�B�B�3�G�
#�
I�6r?N)rKrLrMr^rNr?rrPrP|s��Ir?rPc��eZdZd�Zd�Zy)�
Multiplierc��d|��S)N�M*rN�r�others  r�__mul__zMultiplier.__mul__�s���E�7�|�r?c��|�d�S)N�*MrNrcs  r�__rmul__zMultiplier.__rmul__�s�����|�r?N)rKrLrMrerhrNr?rr`r`�s���r?r`c�N�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
y)
�	TestVec2Dc��tdd�}|j|dd�|j|dd�|j|t�|jtt�|jttd�|jttd�|jtt|�|jttddd�y)N��?�r��rrn)�Vec2Dr9�assertIsInstance�assertRaises�	TypeError�r�vecs  r�test_constructorzTestVec2D.test_constructor�s����C��m������Q���%�����Q���#����c�5�)����)�U�+����)�U�A�.����)�U�F�3����)�U�C�0����)�U�A�q�!�4r?c�R�tdd�}|jt|�d�y)Ng��/�$�?gX9��v��?z(0.57,1.23))rpr9�reprrts  r�	test_reprzTestVec2D.test_repr�s"���E�5�!������c��M�2r?c�$�tdd�}tdd�}tdd�}|j||�|j|t|��|jt|�|�|j||�|j||�y)Nrrn��*)rpr9�tuple�assertNotEqual)rrYrZ�vec3s    r�
test_equalityzTestVec2D.test_equality�s{���Q��{���S�!�}���R��|������t�$�����u�T�{�+�����t��d�+����D�$�'����D�$�'r?c�T�tdd�}ttjdz�D]q}|j	|��5tj
||��}tj|�}|j||�|j|t�ddd��sy#1swY�~xYw)Nrlrmrn)�proto)�protocol)	rp�range�pickle�HIGHEST_PROTOCOL�subTest�dumps�loadsr9rq)rrur��pickled�	unpickleds     r�
test_picklingzTestVec2D.test_pickling�s����C��m���6�2�2�Q�6�7�E����E��*� �,�,�s�U�;��"�L�L��1�	�� � ��C�0��%�%�i��7�	+�*�8�*�*�s�AB�B'	c���|D]X}|j|��5|\\}}}t|�}t|�}|||�}	t|�}|j|	|�ddd��Zy#1swY�exYw)N��case)r�rpr^)
r�
test_cases�lambda_operator�	test_case�first�secondr=�op1�op2�results
          r�_assert_arithmetic_casesz"TestVec2D._assert_arithmetic_cases�so��#�I����9��-�.7�+��%��(��U�m���V�n��(��c�2�� �(�+���-�-�f�h�?�.�-�$�-�-�s�<A�A(	c�2�gd�}|j|d��y)N))��rr�rnrn)��?r�))����r)rmrm)rnrm)))g�?rr�)�@rnc��||zS�NrN��x�ys  r�<lambda>z0TestVec2D.test_vector_addition.<locals>.<lambda>����q�1�ur?�r��rr�s  r�test_vector_additionzTestVec2D.test_vector_addition�s��
�
�	
�%�%�j�2D�Er?c�2�ddg}|j|d��y)N)r�)r�r�)))g@%@��?)�
r)g�?r�c��||z
Sr�rNr�s  rr�z3TestVec2D.test_vector_subtraction.<locals>.<lambda>�r�r?r�r�s  r�test_vector_subtractionz!TestVec2D.test_vector_subtraction�s$��
)�8�
�
�
	
�%�%�j�2D�Er?c���tdd�}tdd�}||z}d}|j||�tdd�}tdd�}|j|dz|�|jd|z|�|j|dz|�|jd|z|�t�}|j	||zt|d�d	�|d
�d	���|j	||zd|���y)Nr�rl��#��g$@rrgrnrb)rprWr^r`r9)rrYrZ�answerr=ru�Ms       r�test_vector_multiplyzTestVec2D.test_vector_multiply�s����R��}���S�!�}�����������v�x�0��C��m����B�<���%�%�c�B�h��9��%�%�b�3�h��9��%�%�c�D�j�(�;��%�%�d�S�j�(�;��L������q��%�3�q�6�(�"�
�#�a�&���}�"E�F�����S��B�s�e�*�-r?c�F�tdd�}d}|j||�y)Nr����)r�r�)rpr^)rrur=s   r�test_vector_negativezTestVec2D.test_vector_negative�s$���B��n�����%�%�s�d�H�5r?c���|jttdd��d�|jttdd��d�|jttdd��d�y)N��r�rr�g@)rW�absrpr9�rs r�
test_distancezTestVec2D.test_distance�sS�����s�5��A�;�/��4�����U�1�a�[�)�1�-����s�5��a�=�1�3�7r?c���gd�}|D]P}|j|��5|\\}}}t|�}|j|�}|j||�ddd��Ry#1swY�]xYw)N)))r�rr�))ro�Zr�))roi�����rnr))r��r�))r��hr�r�)r�rp�rotater^)r�casesr�ru�rotr=�gots       r�test_rotatezTestVec2D.test_rotate�sf��
���D����4��(�'+�$�
��c�H��S�k���j�j��o���-�-�c�8�<�	)�(��(�(�s�4A�A$	N)rKrLrMrvryr�r�r�r�r�r�r�r�r�rNr?rrjrj�s<��
5�3�(�8�
@�F�F�.�&6�
8�
=r?rjc�x�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zy)�TestTNavigatorc�6�tj�|_yr�)r�
TNavigator�navr�s r�setUpzTestTNavigator.setUps���$�$�&��r?c���|jjdd�|j|jj�d�|j|jj	�d�y�Nr���)r��gotorW�xcor�ycorr�s r�	test_gotozTestTNavigator.test_goto	sH�����
�
�c�4� ����t�x�x�}�}���4����t�x�x�}�}���5r?c���|jjddd��|j|jj�d�|j|jj	�d�|jjddd��|j|jj�d�|j|jj	�d�y)N�i��T��fill_gapi��r�F)r��teleportrWr�r�r�s r�
test_teleportzTestTNavigator.test_teleports��������"�c�D��1����t�x�x�}�}���3����t�x�x�}�}���4������#�r�E��2����t�x�x�}�}���4����t�x�x�}�}���3r?c�4�|j|jj�|jj�|jj	dd�|j|jj�|jj�yr�)r9r��pos�	_positionr�r�s r�test_poszTestTNavigator.test_poss\��������������);�);�<����
�
�c�4� �������������);�);�<r?c���|j|jjd�|jjd�|j	|jjd�y)N�r�rr�)r{r�)r9r��_orient�leftr^r�s r�	test_leftzTestTNavigator.test_leftsF��������)�)�8�4����
�
�b���%�%�d�h�h�&6�&6�
�Cr?c���|j|jjd�|jjd�|j	|jjd�y)Nr�r�)rg�)r9r�r��rightr^r�s r�
test_rightzTestTNavigator.test_right sF��������)�)�8�4������r���%�%�d�h�h�&6�&6�	�Br?c��|jjdd�|j|jj�d�|j|jj	�d�|jj�|j|jj�d�|j|jj	�d�y)Nrr�r)r�r�rWr�r��resetr�s r�
test_resetzTestTNavigator.test_reset%s������
�
�c�4� ����t�x�x�}�}���4����t�x�x�}�}���5����������t�x�x�}�}���2����t�x�x�}�}���2r?c��|jjd�tdd�}|j|jj	�|�|jj�|jj
d�|jjd�tdd�}|j|jj	�|�|jt|jjd�y)N�rr��
skldjfldsk)	r��forwardrpr^�positionr�r�rrrs�rr=s  r�test_forwardzTestTNavigator.test_forward-s������������a�=���%�%�d�h�h�&7�&7�&9�8�D����������
�
�b�����������C�=���%�%�d�h�h�&7�&7�&9�8�D����)�T�X�X�%5�%5�|�Dr?c��|jjd�tdd�}|j|jj	�|�|jj�|jj
d�|jjd�tdd�}|j|jj	�|�y)Nr�8���rr�)r��backrpr^r�r�r�r�s  r�test_backwardszTestTNavigator.test_backwards:s������
�
�c����q�>���%�%�d�h�h�&7�&7�&9�8�D������������r�����
�
�c����C�=���%�%�d�h�h�&7�&7�&9�8�Dr?c��|jjd�d}|j|jjt	dd��|�y)Nrr)r�r�rW�distancerpr�s  rr�zTestTNavigator.test_distanceEs>��������������t�x�x�0�0��q���<�h�Gr?c��|jjd�|j|jj�d�|jj	�|j|jj�d�|jj�|j|jj�d�y)Nr�g�m U�!�?)r�r�rW�heading�radians�degreesr�s r�test_radians_and_degreesz'TestTNavigator.test_radians_and_degreesJs������
�
�b�����t�x�x�/�/�1�2�6����������t�x�x�/�/�1�:�>����������t�x�x�/�/�1�2�6r?c	�B�gd�}|D]�\\}}}|j|jj||�|�|j|jj||f�|�|j|jjt||��|���y)N)))rrr{))rrg�F@))rrg�V@))r�rg�`@))r�rg�f@))r�r�g l@))rr�g�p@))rr�g�s@)r9r��towardsrp)r�coordinatesr�r�r=s     r�test_towardszTestTNavigator.test_towardsRs���

��!,��F�Q��H����T�X�X�-�-�a��3�X�>����T�X�X�-�-�q�!�f�5�x�@����T�X�X�-�-�e�A�q�k�:�H�E�!,r?c��|jjd�|j|jj�d�|jjd�|j|jj�d�|jj	d�|j|jj�d�|jt|jjd�|jj�gd�}t|�dz}|D]}|jj|��|j|jj�|�|jj�dt|�z
dz}|D]}|jj	|��|j|jj�|�|jj�gd	�}d
}|D]y}|d
kr%|jj	t|��n|jj|�||z
}|j|jj�|dz��{y)Nr��-�g�������?g����̬`@�sdkfjdsf)r�r���,r�)
r�r�iV���ri.���gfffff&A@g�����I�r�g{�G�=�rr)r�r�rWr�r�rrrsr��sumr9r�)r�	rotationsr��num�
sum_so_fars     r�test_headingzTestTNavigator.test_headinges������
�
�b�����t�x�x�/�/�1�2�6����
�
�b�����t�x�x�/�/�1�3�7������s�����t�x�x�/�/�1�5�9����)�T�X�X�^�^�Z�@�������&�	��Y��#�%���C��H�H�M�M�#���������)�)�+�V�4��������c�)�n�$��+���C��H�H�N�N�3���������)�)�+�V�4�������L�	��
��C��Q�w������s�3�x�(����
�
�c�"��#��J��"�"�4�8�8�#3�#3�#5�z�C�7G�H�
r?c�,�|jjd�|j|jj�d�|jjd�|j|jj�d�|jjd�|j|jj�d�|jjd�|j|jj�d�y)Ng�G�z�Y@g��Q��^�gp=
ף�m@g��Q�B��gףp=�S@i��x)r��
setheadingrWr�r�s r�test_setheadingzTestTNavigator.test_setheading�s��������F�#����t�x�x�/�/�1�6�:������G�$����t�x�x�/�/�1�?�C������H�%����t�x�x�/�/�1�3C�D������F�#����t�x�x�/�/�1�:�>r?c��|jjd�|jjd�|jjd�|j|jj	�d�y)Nrr�r�)gY@gi�)r�r�r�r^r�r�s r�test_positionszTestTNavigator.test_positions�sP������������
�
�b����������%�%�d�h�h�l�l�n�o�Fr?c���|jjd�|jjd�|j|jj	�d�y)N�������Zd;�Y�A)rr)r��setx�setyr^r�r�s r�test_setx_and_setyz!TestTNavigator.test_setx_and_sety�s=�����
�
�j�!����
�
�j�!��%�%�d�h�h�l�l�n�6N�Or?c�L�|jjd�|jjd�|jj�|j	|jj�d�|j
|jj�d�y)Nr�i`y��r�r)r�r�r��homer^r�rWr�r�s r�	test_homezTestTNavigator.test_home�sh�����
�
�b��������!����
�
���%�%�d�h�h�l�l�n�e�<����t�x�x�/�/�1�1�5r?c��|j|jjdd�d�tdd�}|j|jj|�d�tj�}|j
d�|jd�|j|jj|�d�y)	Nr��(�2g)\��(�?g����MbP?g�-�)�?r�r%)rWr�r�rprr�r�r�)rru�another_turtles   r�test_distance_methodz#TestTNavigator.test_distance_method�s������t�x�x�0�0��R�8�"�=��D�$������t�x�x�0�0��5�7J�K��*�*�,�����B�����u�%����t�x�x�0�0��@�%�Hr?N)rKrLrMr�r�r�r�r�r�r�r�r�r�r�rr
rrrrr!rNr?rr�r�sg��'�6�
4�=�
D�
C�
3�E�	E�H�
7�F�& I�D?�G�P�
6�Ir?r�c��eZdZd�Zd�Zd�Zy)�TestTPenc�&�tj�}|j|j��|j	�|j|j��|j
�|j|j��yr�)r�TPen�
assertTrue�isdown�penup�assertFalse�pendown�r�tpens  r�test_pendown_and_penupzTestTPen.test_pendown_and_penup�sW���{�{�}��������
�&��
�
���������'�����������
�&r?c�&�tj�}|j|j��|j	�|j|j��|j
�|j|j��yr�)rr%r&�	isvisible�
hideturtler)�
showturtler+s  r�(test_showturtle_hideturtle_and_isvisiblez1TestTPen.test_showturtle_hideturtle_and_isvisible�s\���{�{�}��������(�)�����������)�*�����������(�)r?c�F�tj�}dD]�}|j�|jdd|��|j	|j��|j
�|jdd|��|j|j����y)N)TFrr�r�)rr%r(r�r)r'r*r&)rr,�fill_gap_values   rr�zTestTPen.test_teleport�ss���{�{�}��+�N��J�J�L��M�M�#�s�^�M�<����T�[�[�]�+��L�L�N��M�M�$��~�M�>��O�O�D�K�K�M�*�
,r?N)rKrLrMr-r2r�rNr?rr#r#�s��'�*�
+r?r#c��eZdZd�Zy)�TestModuleLevelc��ddl}dddddd�}|D]\}|j|��5tt|�}|j	|�}|jt
|�||�ddd��^y#1swY�ixYw)	Nrz3(x=None, y=None, *, fill_gap: bool = False) -> Nonez()z(x, y=None)z(*args)z(pen=None, **pendict))r��undor��bgcolor�pen)�name)�inspectr��getattrr�	signaturer9�str)rr<�known_signaturesr;�obj�sigs      r�test_all_signaturesz#TestModuleLevel.test_all_signatures�s~���F��!� �*�

��%�D����4��(��f�d�+���'�'��,��� � ��S��+;�D�+A�B�)�(�%�(�(�s�AA/�/A8	N)rKrLrMrCrNr?rr6r6�s��Cr?r6�__main__)r��unittest�testr�test.supportrr�
import_modulerrpr7rArD�TestCaserrPr`rjr�r#r6rK�mainrNr?r�<module>rKs���
���&�"�
%��	$�	$�X�	.��������.
����D�x�(�(�D�NI�I���s=�%�x�'8�'8�s=�lfI�*�H�,=�,=�fI�R +�x� � � +�FC�h�'�'�C�(�z���H�M�M�O�r?

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists