OwlCyberSecurity - MANAGER
Edit File: fake_stat_time_test.cpython-311.pyc
� ������hW����������������������������d�Z�ddlZddlZddlmZ�ddlmZ��edd������������Z�G�d��de������������Z�G�d ��d e������������Z �G�d��de ������������Z �G�d ��de������������Z�G�d��de������������Z�G�d��de������������Z �G�d��de ������������Z�G�d��de������������Z�G�d��de������������Z�G�d��de������������Z�G�d��de������������Z�G�d��de������������Z�G�d��d e������������Zed!k����r�ej�����������������������dS�dS�)"z&Unit tests for file timestamp updates.�����N)� namedtuple)�RealFsTestCase�FileTimezst_ctime, st_atime, st_mtimec���������������������������e�Zd�Z��fd�Zd��Zd��Zd��Zd��Zd��Zd��Z d��Z d ��Zd ��Zd��Z d��Zd ��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Z��xZS�)�FakeStatTestBasec�������������������������t������������������������������������������������������������|�������������������������������������|����������������������d������������|�_��������|�j��������rdnd|�_��������d|�_��������d�S�)N� some_fileg�������?g{�G�z�?��)�super�setUp�check_linux_and_windows� make_path� file_path�is_macos� sleep_time�mode��self� __class__s��� ��s/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/pyfakefs/tests/fake_stat_time_test.pyr���zFakeStatTestBase.setUp���sX������� ��� � ����� �$�$�&�&�&�����4�4���!%��8�#�#�D����� � � �����c�����������������������|�j������������������������������|������������}|������������������������������������rt����������j��������|�j���������������������nt����������j�����������������������t ����������|j��������|j��������|j ���������������������S�)N)�st_ctime�st_atime�st_mtime) �os�stat�use_real_fs�time�sleepr���r���r���r���r���)r����pathr���s��� r���� stat_timezFakeStatTestBase.stat_time#���sq�������w�|�|�D�!�!�������� ��J�t��'�'�'�'�� �I�K�K�K���]��]��]� �� �� �� r���c������������������p�����|�j���������r|����������������������||�������������d�S�|����������������������||�������������d�S��N)� is_windows_fs�assertLessEqual� assertLess�r����time1�time2s��� r����assertLessExceptWindowsz(FakeStatTestBase.assertLessExceptWindows1���sC��������� *�� � ���.�.�.�.�.��O�O�E�5�)�)�)�)�)r���c������������������p�����|�j���������r|����������������������||�������������d�S�|����������������������||�������������d�S�r$���)r%���r'����assertEqualr(���s��� r����assertLessExceptPosixz&FakeStatTestBase.assertLessExceptPosix7���sC��������� +��O�O�E�5�)�)�)�)�)����U�E�*�*�*�*�*r���c������������������>����|�������������������������������������5��|����������������������|�j��������|�j��������������������5��|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}||fcd�d�d��������������S�#�1�swxY�w�Y���d�S�r$���)� mock_time�openr���r���r"����r����created�closeds��� r����open_close_new_filez$FakeStatTestBase.open_close_new_file=���s����� �^�^� � �� #�� #����4�>�4�9�5�5�� 9�� 9��.�.���8�8�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9����� 9�� 9�� 9�� 9��^�^�D�N�3�3�F��F�?� #�� #�� #�� #�� #�� #�� #�� #�� #�� #�� #�� #����� #�� #�� #�� #�� #�� #s4����!B�A�B�A! �!B�$A! �% B�B�Bc����������������������|�������������������������������������5��|����������������������|�j��������|�j��������������������5�}|����������������������|�j��������������������}|���������������������d�������������|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|||fS��N�foo)r0���r1���r���r���r"����write)r����fr3����writtenr4���s��� r����open_write_close_new_filez*FakeStatTestBase.open_write_close_new_fileD���s*����� �^�^� � �� 4�� 4����4�>�4�9�5�5�� 9���.�.���8�8����������.�.���8�8�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9����� 9�� 9�� 9�� 9���^�^�D�N�3�3�F� 4�� 4�� 4�� 4�� 4�� 4�� 4�� 4�� 4�� 4�� 4����� 4�� 4�� 4�� 4�����'�'s5����!B=�A B��B=�B �B=�B �B=�=C�Cc����������������������|�������������������������������������5��|����������������������|�j���������������������|����������������������|�j��������������������}|����������������������|�j��������|�j��������������������5��|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}|||fcd�d�d��������������S�#�1�swxY�w�Y���d�S�r$���)r0����create_filer���r"���r1���r����r����before�openedr4���s��� r���� open_closezFakeStatTestBase.open_closeN���s<����� �^�^� � �� *�� *����T�^�,�,�,��^�^�D�N�3�3�F����4�>�4�9�5�5�� 8�� 8������7�7�� 8�� 8�� 8�� 8�� 8�� 8�� 8�� 8�� 8�� 8�� 8����� 8�� 8�� 8�� 8��^�^�D�N�3�3�F��6�6�)� *�� *�� *�� *�� *�� *�� *�� *�� *�� *�� *�� *����� *�� *�� *�� *�� *�� *s6����AC�*B�C�B �C�B �!C�C�Cc����������������������|�������������������������������������5��|����������������������|�j���������������������|����������������������|�j��������������������}|����������������������|�j��������|�j��������������������5�}|����������������������|�j��������������������}|���������������������d�������������|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}||||fcd�d�d��������������S�#�1�swxY�w�Y���d�S�r7���)r0���r>���r���r"���r1���r���r9���)r���r@���r:���rA���r;���r4���s��� r����open_write_closez!FakeStatTestBase.open_write_closeY���s_����� �^�^� � �� 3�� 3����T�^�,�,�,��^�^�D�N�3�3�F����4�>�4�9�5�5�� 9�������7�7����������.�.���8�8�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9����� 9�� 9�� 9�� 9���^�^�D�N�3�3�F��6�7�F�2� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3����� 3�� 3�� 3�� 3�� 3�� 3s7����AC7�*A C��4C7��C �C7�C �"C7�7C;�>C;c����������������������|�������������������������������������5��|����������������������|�j���������������������|����������������������|�j��������������������}|����������������������|�j��������|�j��������������������5�}|����������������������|�j��������������������}|������������������������������������|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}||||fcd�d�d��������������S�#�1�swxY�w�Y���d�S�r$���)r0���r>���r���r"���r1���r����flush)r���r@���r:���rA����flushedr4���s��� r����open_flush_closez!FakeStatTestBase.open_flush_closef���s]����� �^�^� � �� 3�� 3����T�^�,�,�,��^�^�D�N�3�3�F����4�>�4�9�5�5�� 9�������7�7����� � � ��.�.���8�8�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9����� 9�� 9�� 9�� 9���^�^�D�N�3�3�F��6�7�F�2� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3�� 3����� 3�� 3�� 3�� 3�� 3�� 3�7����AC6�*A B?�3C6�?C �C6�C �"C6�6C:�=C:c������������������f����|�������������������������������������5��|����������������������|�j���������������������|����������������������|�j��������������������}|����������������������|�j��������|�j��������������������5�}|����������������������|�j��������������������}|���������������������d�������������|����������������������|�j��������������������}|������������������������������������|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}|||||fcd�d�d��������������S�#�1�swxY�w�Y���d�S�r7���)r0���r>���r���r"���r1���r���r9���rF���)r���r@���r:���rA���r;���rG���r4���s��� r����open_write_flushz!FakeStatTestBase.open_write_flushs���s������ �^�^� � �� <�� <����T�^�,�,�,��^�^�D�N�3�3�F����4�>�4�9�5�5�� 9�������7�7����������.�.���8�8����� � � ��.�.���8�8�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9����� 9�� 9�� 9�� 9���^�^�D�N�3�3�F��6�7�G�V�;� <�� <�� <�� <�� <�� <�� <�� <�� <�� <�� <�� <����� <�� <�� <�� <�� <�� <s7����AD&�*A8C.�"D&�.C2 �2D&�5C2 �6#D&�&D*�-D*c������������������Z����|�������������������������������������5��|����������������������|�j���������������������|����������������������|�j��������������������}|����������������������|�j��������d������������5�}|����������������������|�j��������������������}|������������������������������������|����������������������|�j��������������������}|������������������������������������|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}|||||fcd�d�d��������������S�#�1�swxY�w�Y���d�S��N�r)r0���r>���r���r"���r1����readrF���)r���r@���r:���rA���rO���rG���r4���s��� r����open_read_flushz FakeStatTestBase.open_read_flush����s}����� �^�^� � �� 9�� 9����T�^�,�,�,��^�^�D�N�3�3�F����4�>�3�/�/�� 9�1������7�7���������~�~�d�n�5�5����� � � ��.�.���8�8�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9����� 9�� 9�� 9�� 9���^�^�D�N�3�3�F��6�4��&�8� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9�� 9����� 9�� 9�� 9�� 9�� 9�� 9s7����AD �%A7C(�D �(C, �,D �/C, �0#D � D$�'D$c����������������������|�������������������������������������5��|����������������������|�j��������|�j��������������������5�}|����������������������|�j��������������������}|������������������������������������|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}|||fcd�d�d��������������S�#�1�swxY�w�Y���d�S�r$���)r0���r1���r���r���r"���rO���)r���r:���r3���rO���r4���s��� r����open_read_close_new_filez)FakeStatTestBase.open_read_close_new_file����s2����� �^�^� � �� )�� )����4�>�4�9�5�5�� 6���.�.���8�8���������~�~�d�n�5�5�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6����� 6�� 6�� 6�� 6���^�^�D�N�3�3�F��D�&�(� )�� )�� )�� )�� )�� )�� )�� )�� )�� )�� )�� )����� )�� )�� )�� )�� )�� )s5����!C�A B�?C�B �C�B �!C�C�Cc����������������������|�������������������������������������5��|����������������������|�j���������������������|����������������������|�j��������������������}|����������������������|�j��������|�j��������������������5�}|����������������������|�j��������������������}|������������������������������������|����������������������|�j��������������������}d�d�d��������������n#�1�swxY�w�Y���|����������������������|�j��������������������}||||fcd�d�d��������������S�#�1�swxY�w�Y���d�S�r$���)r0���r>���r���r"���r1���r���rO���)r���r@���r:���rA���rO���r4���s��� r����open_read_closez FakeStatTestBase.open_read_close����s]����� �^�^� � �� 0�� 0����T�^�,�,�,��^�^�D�N�3�3�F����4�>�4�9�5�5�� 6�������7�7���������~�~�d�n�5�5�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6�� 6����� 6�� 6�� 6�� 6���^�^�D�N�3�3�F��6�4��/� 0�� 0�� 0�� 0�� 0�� 0�� 0�� 0�� 0�� 0�� 0�� 0����� 0�� 0�� 0�� 0�� 0�� 0rI���c������������������������|�������������������������������������\��}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)zq When a file is created on opening and closed again, no timestamps are updated on close. N)r5���r-���r���r���r���r2���s��� r����check_open_close_new_filez*FakeStatTestBase.check_open_close_new_file����sp������ ��2�2�4�4��������)�6�?�;�;�;�����)�6�?�;�;�;�����)�6�?�;�;�;�;�;r���c����������������������|�������������������������������������\��}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z When a file is created on opening, st_ctime is updated under Posix, and st_mtime is updated on close. N)r<���r-���r���r+���r���r&���r���r'���)r���r3���r;���r4���s��� r����check_open_write_close_new_filez0FakeStatTestBase.check_open_write_close_new_file����s������� �$(�#A�#A�#C�#C� ���&�����)�7�+;�<�<�<��$�$�W�%5�v��G�G�G�����)�7�+;�<�<�<����W�-�v��?�?�?�����)�7�+;�<�<�<�����(�&�/�:�:�:�:�:r���c����������������������|�������������������������������������\��}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with 'w' or 'w+' mode, st_ctime (Posix only) and st_mtime are updated on open (truncating), but not on close. N)rB���r+���r���r-���r&���r���r'���r���r?���s��� r����check_open_close_w_modez(FakeStatTestBase.check_open_close_w_mode����s������� �"&���!2�!2������$�$�V�_�f�o�F�F�F������&�/�:�:�:����V�_�f�o�>�>�>������&�/�:�:�:��������9�9�9������&�/�:�:�:�:�:r���c����������������������|�������������������������������������\��}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)zz When an existing file is opened with any mode other than 'w' or 'w+', no timestamps are updated. N)rB���r-���r���r���r���r?���s��� r����check_open_close_non_w_modez,FakeStatTestBase.check_open_close_non_w_mode����s������� �"&���!2�!2����������&�/�:�:�:������&�/�:�:�:������&�/�:�:�:������&�/�:�:�:������&�/�:�:�:������&�/�:�:�:�:�:r���c������������������x����|�������������������������������������\��}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with 'w' or 'w+' mode and is then written to, st_ctime (Posix only) and st_mtime are updated on open (truncating) and again on close (flush), but not when written to. N)rD���r+���r���r-���r&���r���r'���r����r���r@���rA���r;���r4���s��� r����check_open_write_close_w_modez.FakeStatTestBase.check_open_write_close_w_mode����s������+/�*?�*?�*A�*A�'������$�$�V�_�f�o�F�F�F������'�*:�;�;�;��$�$�W�%5�v��G�G�G����V�_�f�o�>�>�>������'�*:�;�;�;����W�-�v��?�?�?��������9�9�9������'�*:�;�;�;�����(�&�/�:�:�:�:�:r���c������������������x����|�������������������������������������\��}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with 'w' or 'w+' mode (truncating), st_ctime (Posix only) and st_mtime are updated. No updates are done on flush or close. N)rH���r+���r���r-���r&���r���r'���r����r���r@���rA���rG���r4���s��� r����check_open_flush_close_w_modez.FakeStatTestBase.check_open_flush_close_w_mode����s������+/�*?�*?�*A�*A�'������$�$�V�_�f�o�F�F�F������'�*:�;�;�;�����)�6�?�;�;�;����V�_�f�o�>�>�>������'�*:�;�;�;�����)�6�?�;�;�;��������9�9�9������'�*:�;�;�;�����)�6�?�;�;�;�;�;r���c������������������x����|�������������������������������������\��}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with any mode other than 'w' or 'w+', flushed and closed, no timestamps are updated. N)rH���r-���r���r���r���ra���s��� r����!check_open_flush_close_non_w_modez2FakeStatTestBase.check_open_flush_close_non_w_mode��s����� �+/�*?�*?�*A�*A�'����������&�/�:�:�:������'�*:�;�;�;�����)�6�?�;�;�;������&�/�:�:�:������'�*:�;�;�;�����)�6�?�;�;�;������&�/�:�:�:������'�*:�;�;�;�����)�6�?�;�;�;�;�;r���c������������������x����|�������������������������������������\��}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)zo Reading from a file opened with 'r', 'r+', or 'a+' mode updates st_atime under Posix. N)rT���r-���r���r���r&���r����r���r@���rA���rO���r4���s��� r���� check_open_read_close_non_w_modez1FakeStatTestBase.check_open_read_close_non_w_mode��s����� �(,�';�';�'=�'=�$����f������&�/�:�:�:������$�-�8�8�8��������8�8�8������&�/�:�:�:����V�_�d�m�<�<�<��������8�8�8������&�/�:�:�:������$�-�8�8�8��������8�8�8�8�8r���c����������������������|�������������������������������������\��}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z| When a file is created with 'w+' or 'a+' mode and then read from, st_atime is updated under Posix. N)rR���r-���r���r&���r���r���)r���r3���rO���r4���s��� r����check_open_read_close_new_filez/FakeStatTestBase.check_open_read_close_new_file1��s������� �!%� =� =� ?� ?����v�����)�4�=�9�9�9��������8�8�8����W�-�t�}�=�=�=��������8�8�8�����)�4�=�9�9�9��������8�8�8�8�8r���c������������������x����|�������������������������������������\��}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with 'a', 'a+' or 'r+' mode and is then written to, st_ctime (Posix only) and st_mtime are updated close (flush), but not on opening or when written to. N)rD���r-���r���r+���r���r&���r���r'���r^���s��� r����!check_open_write_close_non_w_modez2FakeStatTestBase.check_open_write_close_non_w_modeA��s������+/�*?�*?�*A�*A�'����������&�/�:�:�:������'�*:�;�;�;��$�$�W�%5�v��G�G�G������&�/�:�:�:������'�*:�;�;�;����W�-�v��?�?�?������&�/�:�:�:������'�*:�;�;�;�����(�&�/�:�:�:�:�:r���c������������������:����|�������������������������������������\��}}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)a�� When an existing file is opened with 'w' or 'w+' mode and is then written to, st_ctime (Posix only) and st_mtime are updated on open (truncating). Under Posix, st_mtime is updated on flush, under Windows, on close instead. N)rK���r&���r���r-���r���r'���r���r+����r���r@���rA���r;���rG���r4���s��� r����#check_open_write_flush_close_w_modez4FakeStatTestBase.check_open_write_flush_close_w_modeU��sh������48�3H�3H�3J�3J�0�����&����V�_�f�o�>�>�>����W�-�w�/?�@�@�@������'�*:�;�;�;�����)�6�?�;�;�;����V�_�f�o�>�>�>������'�*:�;�;�;����W�-�w�/?�@�@�@����W�-�v��?�?�?��������9�9�9������'�*:�;�;�;��$�$�W�%5�w�7G�H�H�H����W�-�v��?�?�?�?�?r���c������������������:����|�������������������������������������\��}}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with 'a', 'a+' or 'r+' mode and is then written to, st_ctime and st_mtime are updated on flush under Posix. Under Windows, only st_mtime is updated on close instead. N)rK���r-���r���r+���r���r&���r���rm���s��� r����'check_open_write_flush_close_non_w_modez8FakeStatTestBase.check_open_write_flush_close_non_w_modem��sj������48�3H�3H�3J�3J�0�����&������&�/�:�:�:������'�*:�;�;�;��$�$�W�%5�w�7G�H�H�H�����)�6�?�;�;�;������&�/�:�:�:������'�*:�;�;�;����W�-�w�/?�@�@�@����W�-�v��?�?�?������&�/�:�:�:������'�*:�;�;�;��$�$�W�%5�w�7G�H�H�H����W�-�v��?�?�?�?�?r���)�__name__� __module__�__qualname__r���r"���r+���r.���r5���r<���rB���rD���rH���rK���rP���rR���rT���rV���rX���rZ���r\���r_���rb���rd���rg���ri���rk���rn���rp���� __classcell__�r���s���@r���r���r������s��������������� �� �� �� �� � �� �� �*��*��*�+��+��+�#��#��#�(��(��(� *�� *�� *�3��3��3�3��3��3� <�� <�� <� 9�� 9�� 9�)��)��)�0��0��0� <�� <�� <�;��;��;� ;��;��;� ;��;��;� ;��;��;�(<��<��<�(<��<��<�&9��9��9�&9��9��9� ;��;��;�(@��@��@�0@��@��@��@��@��@��@r���r���c��������������������H�������e�Zd�Z��fd�Zd��Zd��Zd��Zd��Zd��Zd��Z d��Z ��xZS�) � TestFakeModeWc������������������d������t����������t����������|�������������������������������������������������d|�_��������d�S��N�w)r���rw���r���r���r���s��� �r���r���zTestFakeModeW.setUp����*������� �m�T�"�"�(�(�*�*�*��� � � r���c������������������.�����|��������������������������������������d�S�r$����rV����r���s��� r����test_open_close_new_filez&TestFakeModeW.test_open_close_new_file�����������&�&�(�(�(�(�(r���c������������������.�����|��������������������������������������d�S�r$����rX���r~���s��� r����test_open_write_close_new_filez,TestFakeModeW.test_open_write_close_new_file�����������,�,�.�.�.�.�.r���c������������������.�����|��������������������������������������d�S�r$����rZ���r~���s��� r����test_open_closezTestFakeModeW.test_open_close�����������$�$�&�&�&�&�&r���c������������������.�����|��������������������������������������d�S�r$����r_���r~���s��� r����test_open_write_closez#TestFakeModeW.test_open_write_close�����������*�*�,�,�,�,�,r���c������������������.�����|��������������������������������������d�S�r$����rb���r~���s��� r����test_open_flush_closez#TestFakeModeW.test_open_flush_close���r����r���c������������������.�����|��������������������������������������d�S�r$����rn���r~���s��� r����test_open_write_flush_closez)TestFakeModeW.test_open_write_flush_close�����������0�0�2�2�2�2�2r���c�����������������������|�����������������������|�j��������d������������5�}|����������������������t����������������������5��|������������������������������������d�d�d��������������n#�1�swxY�w�Y���d�d�d��������������d�S�#�1�swxY�w�Y���d�S�ry����r1���r����assertRaises�OSErrorrO����r���r:���s��� r����test_read_raiseszTestFakeModeW.test_read_raises����������� �Y�Y�t�~�s� +� +�� �q��"�"�7�+�+�� �� ������� �� �� �� �� �� �� �� �� �� �� ����� �� �� �� � �� �� �� �� �� �� �� �� �� �� �� ����� �� �� �� �� �� �4����A0�A�A0�A �A0�A � A0�0A4�7A4�rq���rr���rs���r���r���r����r����r����r����r����r����rt���ru���s���@r���rw���rw������s�������������������������)��)��)�/��/��/�'��'��'�-��-��-�-��-��-�3��3��3�������������r���rw���c�������������������������e�Zd�Zd��ZdS�)� TestRealModeWc�����������������������dS��NT��r~���s��� r���r���zTestRealModeW.use_real_fs�����������tr���N�rq���rr���rs���r���r����r���r���r����r��������#����������������������r���r����c��������������������N�������e�Zd�Z��fd�Zd��Zd��Zd��Zd��Zd��Zd��Z d��Z d ��Z��xZS�) �TestFakeModeWPlusc������������������d������t����������t����������|�������������������������������������������������d|�_��������d�S�)Nzw+)r���r����r���r���r���s��� �r���r���zTestFakeModeWPlus.setUp����+������� ���&�&�,�,�.�.�.��� � � r���c������������������.�����|��������������������������������������d�S�r$���r}���r~���s��� r���r���z*TestFakeModeWPlus.test_open_close_new_file���r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z0TestFakeModeWPlus.test_open_write_close_new_file���r����r���c������������������.�����|��������������������������������������d�S�r$����ri���r~���s��� r����test_open_read_close_new_filez/TestFakeModeWPlus.test_open_read_close_new_file�����������+�+�-�-�-�-�-r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z!TestFakeModeWPlus.test_open_close���r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z'TestFakeModeWPlus.test_open_write_close���r����r���c������������������x����|�������������������������������������\��}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with 'w+' mode and is then written to, st_ctime (Posix only) and st_mtime are updated on open (truncating) and again on close (flush). Under Posix, st_atime is updated on read. N)rT���r+���r���r-���r&���r���r'���r���rf���s��� r����test_open_read_closez&TestFakeModeWPlus.test_open_read_close���s������(,�';�';�'=�'=�$����f��$�$�V�_�f�o�F�F�F������$�-�8�8�8��������8�8�8����V�_�f�o�>�>�>����V�_�d�m�<�<�<��������8�8�8��������9�9�9������$�-�8�8�8��������8�8�8�8�8r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z'TestFakeModeWPlus.test_open_flush_close���r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z-TestFakeModeWPlus.test_open_write_flush_close���r����r���� rq���rr���rs���r���r���r����r����r����r����r����r����r����rt���ru���s���@r���r����r�������s�������������������������)��)��)�/��/��/�.��.��.�'��'��'�-��-��-�9��9��9�*-��-��-�3��3��3��3��3��3��3r���r����c�������������������������e�Zd�Zd��ZdS�)�TestRealModeWPlusc�����������������������dS�r����r����r~���s��� r���r���zTestRealModeWPlus.use_real_fs���r����r���Nr����r����r���r���r����r�������r����r���r����c��������������������H�������e�Zd�Z��fd�Zd��Zd��Zd��Zd��Zd��Zd��Z d��Z ��xZS�) � TestFakeModeAc������������������d������t����������t����������|�������������������������������������������������d|�_��������d�S��N�a)r���r����r���r���r���s��� �r���r���zTestFakeModeA.setUp���r{���r���c������������������.�����|��������������������������������������d�S�r$���r}���r~���s��� r���r���z&TestFakeModeA.test_open_close_new_file���r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z,TestFakeModeA.test_open_write_close_new_file���r����r���c������������������.�����|��������������������������������������d�S�r$����r\���r~���s��� r���r����zTestFakeModeA.test_open_close�����������(�(�*�*�*�*�*r���c������������������.�����|��������������������������������������d�S�r$����rk���r~���s��� r���r����z#TestFakeModeA.test_open_write_close�����������.�.�0�0�0�0�0r���c������������������.�����|��������������������������������������d�S�r$����rd���r~���s��� r���r����z#TestFakeModeA.test_open_flush_close���r����r���c������������������.�����|��������������������������������������d�S�r$����rp���r~���s��� r���r����z)TestFakeModeA.test_open_write_flush_close�����������4�4�6�6�6�6�6r���c�����������������������|�����������������������|�j��������d������������5�}|����������������������t����������������������5��|������������������������������������d�d�d��������������n#�1�swxY�w�Y���d�d�d��������������d�S�#�1�swxY�w�Y���d�S�r����r����r����s��� r���r����zTestFakeModeA.test_read_raises���r����r����r����ru���s���@r���r����r�������s�������������������������)��)��)�/��/��/�+��+��+�1��1��1�1��1��1�7��7��7�������������r���r����c�������������������������e�Zd�Zd��ZdS�)� TestRealModeAc�����������������������dS�r����r����r~���s��� r���r���zTestRealModeA.use_real_fs���r����r���Nr����r����r���r���r����r�������r����r���r����c��������������������N�������e�Zd�Z��fd�Zd��Zd��Zd��Zd��Zd��Zd��Z d��Z d ��Z��xZS�) �TestFakeModeAPlusc������������������d������t����������t����������|�������������������������������������������������d|�_��������d�S�)Nza+)r���r����r���r���r���s��� �r���r���zTestFakeModeAPlus.setUp���r����r���c������������������.�����|��������������������������������������d�S�r$���r}���r~���s��� r���r���z*TestFakeModeAPlus.test_open_close_new_file��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z0TestFakeModeAPlus.test_open_write_close_new_file��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z/TestFakeModeAPlus.test_open_read_close_new_file ��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z!TestFakeModeAPlus.test_open_close��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z'TestFakeModeAPlus.test_open_write_close��r����r���c������������������.�����|��������������������������������������d�S�r$����rg���r~���s��� r���r����z&TestFakeModeAPlus.test_open_read_close����������-�-�/�/�/�/�/r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z'TestFakeModeAPlus.test_open_flush_close��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z-TestFakeModeAPlus.test_open_write_flush_close��r����r���r����ru���s���@r���r����r�������s�������������������������)��)��)�/��/��/�.��.��.�+��+��+�1��1��1�0��0��0�1��1��1�7��7��7��7��7��7��7r���r����c�������������������������e�Zd�Zd��ZdS�)�TestRealModeAPlusc�����������������������dS�r����r����r~���s��� r���r���zTestRealModeAPlus.use_real_fs��r����r���Nr����r����r���r���r����r������r����r���r����c��������������������<�������e�Zd�Z��fd�Zd��Zd��Zd��Zd��Zd��Z��xZ S�)� TestFakeModeRc������������������d������t����������t����������|�������������������������������������������������d|�_��������d�S�rM���)r���r����r���r���r���s��� �r���r���zTestFakeModeR.setUp"��r{���r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����zTestFakeModeR.test_open_close&��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z"TestFakeModeR.test_open_read_close)��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z#TestFakeModeR.test_open_flush_close,��r����r���c������������������:����|�������������������������������������\��}}}}}|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������|����������������������|j��������|j���������������������dS�)z� When an existing file is opened with 'r' mode, read, flushed and closed, st_atime is updated after reading under Posix. N)rP���r-���r���r���r&���r���)r���r@���rA���rO���rG���r4���s��� r����test_open_read_flush_closez(TestFakeModeR.test_open_read_flush_close/��sd����� �15�0D�0D�0F�0F�-����g�v������&�/�:�:�:������$�-�8�8�8�������(8�9�9�9�����)�6�?�;�;�;������&�/�:�:�:����V�_�d�m�<�<�<�������(8�9�9�9�����)�6�?�;�;�;������&�/�:�:�:������$�-�8�8�8�������(8�9�9�9�����)�6�?�;�;�;�;�;r���c������������������������|�����������������������t����������������������5��|����������������������|�j��������d������������5�� �d�d�d��������������n#�1�swxY�w�Y���d�d�d��������������d�S�#�1�swxY�w�Y���d�S�rM����r����r����r1���r���r~���s��� r����test_open_not_existing_raisesz+TestFakeModeR.test_open_not_existing_raisesE��s������� � � �w� '� '�� �� ����4�>�3�/�/�� �� �� �� �� �� �� �� �� �� �� �� �� ����� �� �� �� � �� �� �� �� �� �� �� �� �� �� �� ����� �� �� �� �� �� �3����A�A�A�A � A�A � A�A!�$A!) rq���rr���rs���r���r����r����r����r����r����rt���ru���s���@r���r����r����!��s�������������������������+��+��+�0��0��0�1��1��1�<��<��<�,������������r���r����c�������������������������e�Zd�Zd��ZdS�)� TestRealModeRc�����������������������dS�r����r����r~���s��� r���r���zTestRealModeR.use_real_fsL��r����r���Nr����r����r���r���r����r����K��r����r���r����c��������������������B�������e�Zd�Z��fd�Zd��Zd��Zd��Zd��Zd��Zd��Z ��xZ S�)�TestFakeModeRPlusc������������������d������t����������t����������|�������������������������������������������������d|�_��������d�S��Nzr+)r���r����r���r���r���s��� �r���r���zTestFakeModeRPlus.setUpQ��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z!TestFakeModeRPlus.test_open_closeU��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z'TestFakeModeRPlus.test_open_write_closeX��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z&TestFakeModeRPlus.test_open_read_close[��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z'TestFakeModeRPlus.test_open_flush_close^��r����r���c������������������.�����|��������������������������������������d�S�r$���r����r~���s��� r���r����z-TestFakeModeRPlus.test_open_write_flush_closea��r����r���c������������������������|�����������������������t����������������������5��|����������������������|�j��������d������������5�� �d�d�d��������������n#�1�swxY�w�Y���d�d�d��������������d�S�#�1�swxY�w�Y���d�S�r����r����r~���s��� r���r����z/TestFakeModeRPlus.test_open_not_existing_raisesd��s������� � � �w� '� '�� �� ����4�>�4�0�0�� �� �� �� �� �� �� �� �� �� �� �� �� ����� �� �� �� � �� �� �� �� �� �� �� �� �� �� �� ����� �� �� �� �� �� r����)rq���rr���rs���r���r����r����r����r����r����r����rt���ru���s���@r���r����r����P��s�������������������������+��+��+�1��1��1�0��0��0�1��1��1�7��7��7�������������r���r����c�������������������������e�Zd�Zd��ZdS�)�TestRealModeRPlusc�����������������������dS�r����r����r~���s��� r���r���zTestRealModeRPlus.use_real_fsk��r����r���Nr����r����r���r���r����r����j��r����r���r�����__main__)�__doc__r����unittest�collectionsr����pyfakefs.tests.test_utilsr���r���r���rw���r����r����r����r����r����r����r����r����r����r����r����rq����mainr����r���r����<module>r�����s������-��,������������"��"��"��"��"��"��4��4��4��4��4��4��:�j�"@�A�A��k@��k@��k@��k@��k@�~��k@��k@��k@�\���������$�������:���������M������� -3��-3��-3��-3��-3�(��-3��-3��-3�`���������)������� ���������$�������:���������M������� 7��7��7��7��7�(��7��7��7�<���������)������� '��'��'��'��'�$��'��'��'�T���������M������� ���������(�������4���������)������� ��z����H�M�O�O�O�O�O���r���