
                           S r SSKJr  SSKJr  SSKJr  SSKJr  SSKrSSKrSSKrSSK	r	SSK
Jr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJs  Jr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ r   SSKJ!r!  SSKJ"r"  SSK#J$r$  SSK#J%r%  SSK#J&r&  SSK#J'r'  SSK#J(r(  SSK#J)r)  SSK*J+r+  SSK*J,r,  SSK*J-r-  SSK*J.r.  SSK/J0r0  SS K/J1r1  SS!K/J2r2  SS"K/J3r3  SS#K/J4r4  SS$K/J5r5  SS%K6J7r7  SS&K8J9r9  SS'K8J:r:  SS(K;J<r<  SS)K;J=r=  SS*K>J?r?  SS+K@JArA  SS,K@JBrB  SS-KCJDrD  SS.KEJFrF  SS/KEJGrG  SS0KEJHrH  S1rIS2rJ\9S3-  rKS4rL\L4S5 jrMS6 rN  S?S7 jrO  S?S8 jrP  S?S9 jrQ  S?S: jrR " S; S<\R                  5      rT " S= S>\R                  5      rVg)@zTests for gsutil UI functions.    )absolute_import)print_function)division)unicode_literalsN)queue)ApiSelector)ObjectFromTracker)WriteParallelUploadTrackerFile)StorageUrlFromString)	SkipForS3)HaltingCopyCallbackHandler)#HaltOneComponentCopyCallbackHandler)ObjectToURI)SetBotoConfigForTest)TailSet)TEST_ENCRYPTION_KEY1)TEST_ENCRYPTION_KEY2)unittest)FileMessage)FinalMessage)MetadataMessage)ProducerThreadMessage)ProgressMessage)SeekAheadMessage)DeleteTrackerFile)!GetSlicedDownloadTrackerFilePaths)GetTrackerFilePath)TrackerFileType)BytesToFixedWidthString)DataManager)MainThreadUIQueue)MetadataManager)UIController)UIThread)UsingCrcmodExtension)START_CALLBACK_PER_BYTES)UTF8)PARALLEL_UPLOAD_STATIC_SALT)PARALLEL_UPLOAD_TEMP_NAMESPACE)GetMd5)PutToQueueWithTimeout)ZERO_TASKS_TO_DO_ARGUMENT)Retry)HumanReadableWithDecimalPlaces)MakeHumanReadable)ONE_KIB,  i        c                 f    U R                  U5        U R                  5       (       a  [        S5      eg)zJoins the ui_thread and ensures it has not timed out.

Args:
  ui_thread: the UIThread to be joined.
  thread_wait_time: the time to wait to join
Raises:
  Exception: Warns UIThread is still alive.
zUIThread is still aliveN)joinis_alive	Exception)	ui_threadthread_wait_times     &platform/gsutil/gslib/tests/test_ui.pyJoinThreadAndRaiseOnTimeoutr;   W   s1     ..!"
-
..     c                     U (       a  S$ S$ )zReturns the correspondent string (objects or files) for the operation type.

Args:
  metadata: Describes whether this is a metadata operation.
Returns:
  ' objects' if a metadata operation; ' files' otherwise.
z objectsz files metadatas    r:   !_FindAppropriateDescriptionStringrA   e   s      -X-r<   c                 <   [        U5      nU R                  SU5        [        U5      S-   [        U5      -   nU R                  Xe-   U5        SU-  nU(       d4  [        U5      nU R                  US-   U-   U5        US[	        U5      -  -  nU R                  Xq5        g)a  Checks if the UI output works as expected with the -m flag enabled.

Args:
  test_case: Testcase used to maintain the same assert structure.
  content: The output provided by the UI.
  num_objects: The number of objects processed.
  total_size: The total size transferred in the operation. Used for data
              operations only.
  metadata: Indicates whether this is a metadata operation.
	100% Done/#Operation completed over %s objects/%sN)rA   assertInstrr   r.   		test_casecontentnum_objects
total_sizer@   description_stringfiles_completed_stringfinal_messagetotal_size_strings	            r:   CheckUiOutputWithMFlagrR   s   s     9B['*{+c1C4DD+@'J7+E-	/
;(3.1BBGLU;JGGGM],r<   c                     [        U5      n[        U5      nU R                  Xe-   U5        SU-  nU(       d4  [        U5      nU R                  US-   U-   U5        US[	        U5      -  -  nU R                  Xq5        g)a  Checks if the UI output works as expected with the -m flag not enabled.

Args:
  test_case: Testcase used to maintain the same assert structure.
  content: The output provided by the UI.
  num_objects: The number of objects processed.
  total_size: The total size transferred in the operation. Used for data
              operations only.
  metadata: Indicates whether this is a metadata operation.
rE   rD   rF   N)rA   rH   rG   r   r.   rI   s	            r:   CheckUiOutputWithNoMFlagrT      s     9B{++@'J7+E-	/
;(3.1BBGLU;JGGGM],r<   c                 Z   [        U5      nU R                  SU5        [        U5      S-   [        U5      -   nU R                  Xe-   U5        U(       dF  [        U5      n[        S5      nU R	                  US-   U-   U5        U R                  US-   U-   U5        Sn	U R                  X5        g)a  Checks if the UI output fails as expected with the -m flag enabled.

Args:
  test_case: Testcase used to maintain the same assert structure.
  content: The output provided by the UI.
  num_objects: The number of objects processed.
  total_size: The total size transferred in the operation. Used for data
              operations only.
  metadata: Indicates whether this is a metadata operation.
rC   rD   r   Operation completed overN)rA   assertNotInrH   r   rG   )
rJ   rK   rL   rM   r@   rN   rO   rQ   zerofinal_message_prefixs
             r:   CheckBrokenUiOutputWithMFlagrZ      s     9BW-{+c1C4DD.CWM	/
;"1%Dtcz$55w?+c14EEwO3,6r<   c                 V   [        U5      n[        S5      nU R                  Xe-   U5        [        U5      nU R                  Xu-   U5        U(       dF  [	        U5      n[	        S5      n	U R                  U	S-   U-   U5        U R                  US-   U-   U5        Sn
U R                  X5        g)a  Checks if the UI output fails as expected with the -m flag not enabled.

Args:
  test_case: Testcase used to maintain the same assert structure.
  content: The output provided by the UI.
  num_objects: The number of objects processed.
  total_size: The total size transferred in the operation. Used for data
              operations only.
  metadata: Indicates whether this is a metadata operation.
r   rD   rV   N)rA   rH   rG   rW   r   )rJ   rK   rL   rM   r@   rN   no_files_stringrO   rQ   rX   rY   s              r:   CheckBrokenUiOutputWithNoMFlagr]      s     9BF/_97C{+.CWM	/
;"1%Dtcz$55w?+c14EEwO3,6r<   c                      \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 r\" S5      S 5       r\" S5      S 5       r S'S jrS rS rS rS rS'S jr\" S5      S 5       r\" S5      S 5       r\R2                  " \" 5       S5      \" S5      S'S j5       5       r\" S5      S 5       r\" S5      S 5       rS rS rS r S r!S  r"S! r#S" r$S'S# jr%S$ r&S% r'S&r(g)(TestUi   z#Integration tests for UI functions.c                     U R                  5       nS[        -  nU R                  USUS9nU R                  5       nU R	                  SS[        U5      U/SS9n[        XS[        S	9  g
)zTests UI for a single object download with the -m flag enabled.

This test indirectly tests the correctness of ProducerThreadMessage in the
UIController.
   dfoo
bucket_uriobject_namecontents-mcpTreturn_stderr   rM   N)CreateBucketDOWNLOAD_SIZECreateObjectCreateTempFile	RunGsUtilsurirR   selfre   file_contents
object_urifpathstderrs         r:   +test_ui_download_single_objects_with_m_flag2TestUi.test_ui_download_single_objects_with_m_flag   s{     ""$J=(M""j/4,9 # ;J !E^^T4j)95A*.  0F4}Er<   c                     U R                  5       nS[        -  nU R                  USUS9nU R                  5       nU R	                  S[        U5      U/SS9n[        XS[        S9  g	)
zTests UI for a single object download with the -m flag not enabled.

The UI should behave differently from the -m flag option because in the
latter we have a ProducerThreadMessage that allows us to know our progress
percentage and total number of files.
rb   rc   rd   ri   Trj   rl   rm   N)rn   ro   rp   rq   rr   rs   rT   rt   s         r:   .test_ui_download_single_objects_with_no_m_flag5TestUi.test_ui_download_single_objects_with_no_m_flag  ss     ""$J=(M""j/4,9 # ;J !E^^T4
#3U;4^PFT1Gr<   c                     U R                  5       nS[        -  nU R                  SUS9nU R                  SS[	        U5      [	        U5      /SS9n[        XS[        S	9  g
)zTests UI for a single object upload with -m flag enabled.

This test indirectly tests the correctness of ProducerThreadMessage in the
UIController.
   usample-file.txt	file_namerg   rh   ri   Trj   rl   rm   N)rn   UPLOAD_SIZErq   rr   rs   rR   ru   re   rv   rx   ry   s        r:   (test_ui_upload_single_object_with_m_flag/TestUi.test_ui_upload_single_object_with_m_flag  sp     ""$J;&M*;)6   8E^^	tT%[$z"234  IF 4{Cr<   c                     U R                  5       nS[        -  nU R                  SUS9nU R                  S[	        U5      [	        U5      /SS9n[        XS[        S9  g	)
zTests UI for a single object upload with -m flag not enabled.

The UI should behave differently from the -m flag option because in the
latter we have a ProducerThreadMessage that allows us to know our progress
percentage and total number of files.
r   r   r   ri   Trj   rl   rm   N)rn   r   rq   rr   rs   rT   r   s        r:   +test_ui_upload_single_object_with_no_m_flag2TestUi.test_ui_upload_single_object_with_no_m_flag   sn     ""$J;&M*;)6   8E^^	tE{D,-T  CF T1Er<   c                 `   U R                  5       nSnSS/nSn[        U5       HL  n[        S-  nSU-  nU R                  US[	        U5      -   US9nXF-  nUR                  [        U5      5        MN     U R                  5       n	UR                  U	5        U R                  US	S
9n
[        X
X$S9  g)zTests UI for a multiple object download with the -m flag enabled.

This test indirectly tests the correctness of ProducerThreadMessage in the
UIController.
   rh   ri   r      rb   rc   rd   Trj   rm   N)
rn   rangero   rp   rH   appendrs   CreateTempDirrr   rR   ru   re   rL   argument_listrM   i	file_sizerv   rw   rx   ry   s              r:   -test_ui_download_multiple_objects_with_m_flag4TestUi.test_ui_download_multiple_objects_with_m_flag0  s     ""$JK4LMJ;1$iY&m$$
16Q.; % =j j4
+,    E^^M^>F4Lr<   c                 ^   U R                  5       nSnS/nSn[        U5       HL  n[        S-  nSU-  nU R                  US[	        U5      -   US9nXF-  nUR                  [        U5      5        MN     U R                  5       n	UR                  U	5        U R                  USS	9n
[        X
X$S
9  g)a   Tests UI for a multiple object download with the -m flag not enabled.

The UI should behave differently from the -m flag option because in the
latter we have a ProducerThreadMessage that allows us to know our progress
percentage and total number of files.
r   ri   r   r   rb   rc   rd   Trj   rm   N)
rn   r   ro   rp   rH   r   rs   r   rr   rT   r   s              r:   0test_ui_download_multiple_objects_with_no_m_flag7TestUi.test_ui_download_multiple_objects_with_no_m_flagI  s     ""$JKFMJ;1$iY&m$$
16Q.; % =j j4
+,    E^^M^>FT;Nr<   c                 P   U R                  5       nSnSS/nSn[        U5       HK  n[        S-  nSU-  nU R                  S[	        U5      -   US9nXF-  nUR                  [        U5      5        MM     UR                  [        U5      5        U R                  US	S
9n	[        X	X$S9  g)zTests UI for a multiple object upload with -m flag enabled.

This test indirectly tests the correctness of ProducerThreadMessage in the
UIController.
r   rh   ri   r   r   r   rc   r   Trj   rm   N)	rn   r   r   rq   rH   r   rs   rr   rR   
ru   re   rL   r   rM   r   r   rv   rx   ry   s
             r:   +test_ui_upload_mutliple_objects_with_m_flag2TestUi.test_ui_upload_mutliple_objects_with_m_flagc  s     ""$JK4LMJ;"iY&m!!ECFN+8 " :ej4;'   j)*^^M^>F4Lr<   c                 N   U R                  5       nSnS/nSn[        U5       HK  n[        S-  nSU-  nU R                  S[	        U5      -   US9nXF-  nUR                  [        U5      5        MM     UR                  [        U5      5        U R                  USS	9n	[        X	X$S
9  g)zTests UI for a multiple object upload with -m flag not enabled.

The UI should behave differently from the -m flag option because in the
latter we have a ProducerThreadMessage that allows us to know our progress
percentage and total number of files.
r   ri   r   r   r   rc   r   Trj   rm   N)	rn   r   r   rq   rH   r   rs   rr   rT   r   s
             r:   .test_ui_upload_mutliple_objects_with_no_m_flag5TestUi.test_ui_upload_mutliple_objects_with_no_m_flagz  s     ""$JKFMJ;"iY&m!!ECFN+8 " :ej4;'   j)*^^M^>FT;Nr<   z#No resumable upload support for S3.c                 8   U R                  5       nU R                  S[        -  S9nSS[        [        5      4SS[        [        5      4/nU R                  [
        R                  " [        SS5      5      S9n[        U5         U R                  SS	S
XB[        U5      /SSS9nU R                  SU5        [        XS[        S9  U R                  SS	U[        U5      /SS9nU R                  SU5        [        XS[        S9  SSS5        g! , (       d  f       g= f)zzTests UI for upload resumed after a connection break with -m flag.

This was adapted from test_cp_resumable_upload_break.
   arg   GSUtilresumable_threshold(parallel_composite_upload_component_sizeTr3   rh   ri   --testcallbackfilerl   expected_statusrk   Artifically halting uploadrm   rj   Resuming uploadN)rn   rq   	HALT_SIZErH   r0   pickledumpsr   r   rr   rs   rG   rZ   rR   ru   re   rx   boto_config_for_testtest_callback_filery   s         r:   *test_ui_resumable_upload_break_with_m_flag1TestUi.test_ui_resumable_upload_break_with_m_flag  s&    ""$J	)9:E	(#g,7	=s7|L ,,8qAB - D 
2	3~~
*,>
z
 /0,0  2f mm0&9"4yI~~ud:.
/t  Ef
mm%v.T1C 
4	3	3s   A?D
Dc           
      4   U R                  5       nU R                  S[        -  S9nSS[        [        5      4SS[        [        5      4/nU R                  [
        R                  " [        SS5      5      S9n[        U5         U R                  SS	XB[        U5      /S
SS9nU R                  SU5        [        XS
[        S9  U R                  SU[        U5      /SS9nU R                  SU5        [        XS
[        S9  SSS5        g! , (       d  f       g= f)z}Tests UI for upload resumed after a connection break with no -m flag.

This was adapted from test_cp_resumable_upload_break.
r   r   r   r   r   Tr3   ri   r   rl   r   r   rm   rj   r   N)rn   rq   r   rH   r0   r   r   r   r   rr   rs   rG   r]   rT   r   s         r:   -test_ui_resumable_upload_break_with_no_m_flag4TestUi.test_ui_resumable_upload_break_with_no_m_flag  s!    ""$J	)9:E	(#g,7	=s7|L ,,8qAB - D 
2	3~~
$&8
z
 /0,0  2f mm0&9$T1K~~tUD,<=,0  2f
mm%v.tQ9E 
4	3	3s   A=D		
DNc                 (   U(       d  / nU R                  5       nS[        -  nU R                  USUS9nU R                  5       nU R                  [        R
                  " [        SS5      5      S9n[        U5         USSU[        U5      U/-   nU R                  US	S
S9n	U R                  SU	5        SU;  a%  SU;   a  [        X	S	[        S9  O[        X	S	[        S9  [        [        U5      [        R                   U R"                  5      n
U R%                  [&        R(                  R+                  U
5      5        US[        U5      U/-   nU R                  US
S9n	SU;  a  U R                  SU	5        SSS5        [-        US5       nU R/                  UR1                  5       US5        SSS5        SU;   a  U R/                  SW	5        gSU;   a  [3        U W	S	[        S9  g[5        U W	S	[        S9  g! , (       d  f       N= f! , (       d  f       N`= f)a  Helper function for testing UI on a resumable download break.

This was adapted from _test_cp_resumable_download_break_helper.

Args:
  boto_config: List of boto configuration tuples for use with
      SetBotoConfigForTest.
  gsutil_flags: List of flags to run gsutil with, or None.
r   rc   rd   Fr3   r   ri   r   rl   Tr   zArtifically halting download.-qrh   rm   rj   Resuming downloadNrbFile contents differ )rn   r   rp   rq   r   r   r   r   rs   rr   rG   rZ   r]   r   r   r   DOWNLOADtest_api
assertTrueospathisfileopenassertEqualreadrR   rT   )ru   boto_configgsutil_flagsre   rv   rw   rx   r   gsutil_argsry   tracker_filenamefs               r:   (_test_ui_resumable_download_break_helper/TestUi._test_ui_resumable_download_break_helper  s    l""$J9$M""j/4,9 # ;J !E,,8BC - E 
k	*!
$&8
z
E% k ~~k./,0  2f mm3V<	\	!<
&tQ9
M
(qY
O+,@,G,;,D,D,0MM; oobggnn%567 D$z*:E#BBk~~k~>f	[	 )62+ 
+. 
eT	a
qvvx0FG 
|
r6"		T61CtVQ9E= 
+	*. 
	s   <C7G2"H2
H 
Hc                 H    U R                  SS[        [        5      4/S/S9  g)znTests UI on a resumable download break with -m flag.

This was adapted from test_cp_resumable_download_break.
r   r   rh   r   Nr   rH   r0   ru   s    r:   ,test_ui_resumable_download_break_with_m_flag3TestUi.test_ui_resumable_download_break_with_m_flag  s.    
 	11
)3w<	89 2 Pr<   c                 H    U R                  SS[        [        5      4/5        g)zqTests UI on a resumable download break with no -m flag.

This was adapted from test_cp_resumable_download_break.
r   r   Nr   r   s    r:   /test_ui_resumable_download_break_with_no_m_flag6TestUi.test_ui_resumable_download_break_with_no_m_flag  s&    
 	11	(#g,73 r<   c                 H    U R                  SS[        [        5      4/S/S9  g)zTests UI on a resumable download break with -q flag but no -m flag.

This was adapted from test_cp_resumable_download_break, and the UI output
should be empty.
r   r   r   r   Nr   r   s    r:   ,test_ui_resumable_download_break_with_q_flag3TestUi.test_ui_resumable_download_break_with_q_flag  s.     	11
)3w<	89 2 Pr<   c                 J    U R                  SS[        [        5      4/SS/S9  g)zTests UI on a resumable download break with -q and -m flags.

This was adapted from test_cp_resumable_download_break, and the UI output
should be empty.
r   r   rh   r   r   Nr   r   s    r:   3test_ui_resumable_download_break_with_q_and_m_flags:TestUi.test_ui_resumable_download_break_with_q_and_m_flags  s0     	11
)3w<	89D\ 2 #r<   c           	      p   U(       d  / nU R                  5       n[        [        US5      5      nSnSnU R                  UUS9n[        U5      n[	        U[
        R                  U R                  U5      nSn	[        U-   R                  [        5      n
[        5       nUR                  U
5        UR                  5       nU	[        -   U-   S-   nSnU R                  UUUSU S	9n[!        U[#        UR$                  5      5      nU/n['        XU5         [)        S
SS[#        U5      4/5         USU[        US5      /-   nU R+                  USS9nU R-                  SU5        U R/                  [0        R2                  R5                  U5      SU-  5        U R+                  S[        US5      /SS9nU R7                  UR                  [        5      U5        SU;   a  [9        U US[;        U5      S9  O[=        U US[;        U5      S9  SSS5        [?        U5        g! , (       d  f       N= f! [?        U5        f = f)zHelps testing UI on a resumable upload with finished components.

Args:
  gsutil_flags: List of flags to run gsutil with, or None.
rc   s   foobarfoobar)rg   r   123_0r   Nrd   )r   #parallel_composite_upload_threshold1r   r   ri   Trj   z/Found 1 existing temporary components to reuse.z)Tracker file %s should have been deleted.catreturn_stdoutrh   rl   rm   ) rn   r   rs   rq   r   r   PARALLEL_UPLOADr   r(   encoder'   r*   update	hexdigestr)   rp   r	   rH   
generationr
   r   rr   rG   assertFalser   r   existsr   rR   lenrT   r   )ru   r   re   dst_urlrv   r   source_filesrc_urltracker_file_nametracker_prefixencoded_namecontent_md5digestcomponent_object_namecomponent_sizerw   existing_componentexisting_componentsr   ry   read_contentss                        r:   '_test_ui_composite_upload_resume_helper.TestUi._test_ui_composite_upload_resume_helper'  sj    l""$J"4
E#:;GMI%%}09 & ;K";/G +7+:+J+J+/=='C N 0+=EEdKL(K|$""$F+.LL#$&*+ N""j/D,9/>,J # LJ ++@+.z/D/D+EG-."#4#68+
@?~ ! 	 ;Z 789 	 4@GPGGNN,-7:KK	M tJ/F'G59 ' ;--d3]C<
 vqS=O
P
"4#)#$.1-.@B'	2 )*3	 	2 )*s%   H( *CHH( 
H%!H( (H5c                 $    U R                  S/S9  g)zDTests UI on a resumable upload with finished components and -m flag.rh   r   Nr   r   s    r:   +test_ui_composite_upload_resume_with_m_flag2TestUi.test_ui_composite_upload_resume_with_m_flagp  s     	00tf0Er<   c                 $    U R                  5         gzLTests UI on a resumable upload with finished components and no -m flag.
    Nr   r   s    r:   .test_ui_composite_upload_resume_with_no_m_flag5TestUi.test_ui_composite_upload_resume_with_no_m_flagu  s     	002r<   z%Sliced download requires fast crcmod.z"No sliced download support for S3.c           	      F   U(       d  / nU R                  5       nU R                  USS[        -  S9nU R                  5       nU R                  [        R
                  " [        S5      5      S9nSS[        [        5      4SS[        [        5      4S	/n[        U5         US
SU[        U5      [        U5      /-   nU R                  USSS9nSU;   a  [        U US[        S5      [        -  S9  O[        U US[        S5      [        -  S9  [        [        U5      U R                   5      n	U	 H1  n
U R#                  [$        R&                  R)                  U
5      5        M3     US
[        U5      U/-   nU R                  USS9nU R+                  SU5        U R+                  SU5        [        [        U5      U R                   5      n	U	 H1  n
U R-                  [$        R&                  R)                  U
5      5        M3     [/        US5       nU R1                  UR3                  5       S[        -  S5        SSS5        SU;   a  [5        U US[        S5      [        -  S9  O[7        U US[        S5      [        -  S9  SSS5        g! , (       d  f       NV= f! , (       d  f       g= f)zHelps testing UI for sliced download with some finished components.

This was adapted from test_sliced_download_partial_resume_helper.

Args:
  gsutil_flags: List of flags to run gsutil with, or None.
rc   s   abcrd   r3   r   r   r    sliced_object_download_threshold)r   %sliced_object_download_max_components3ri   r   Trl   )rk   r   rh   abcrm   rj   r   zDownload already completerr   N)rn   rp   r   rq   r   r   r   rH   r   rs   rr   rZ   r   r]   r   r   r   r   r   r   r   rG   r   r   r   r   rR   rT   )ru   r   re   rw   rx   r   r   r   ry   tracker_filenamesr   r   s               r:   ._test_ui_sliced_download_partial_resume_helper5TestUi._test_ui_sliced_download_partial_resume_helper{  s    l""$J""j/4,2Y,> # @J !E,,A!DE - G 
(#i.9	5s9~F@ 
2	3 
$&8
z

u+$ k ~~k,0./  1f 
	$T%+%&14Ui1G	J
 	't'-'(36u:	3I	L
 <
u
%t}}6/
'789 0 D$z*:E#BBk~~k~>f
mm'0
mm/8 <
u
%t}}6/
(89: 0 sq59#46LM 		t% +.u:	+A	D
 	!!'!"-0Z)-C	F[ 
4	3J K 
4	3s&   E*J)J1AJ
J	J
J c                 $    U R                  S/S9  g)zKTests UI on a resumable download with finished components and -m flag.
    rh   r   Nr  r   s    r:   9test_ui_sliced_download_partial_resume_helper_with_m_flag@TestUi.test_ui_sliced_download_partial_resume_helper_with_m_flag  s     	77dV7Lr<   c                 $    U R                  5         gr  r  r   s    r:   =_test_ui_sliced_download_partial_resume_helper_with_no_m_flagDTestUi._test_ui_sliced_download_partial_resume_helper_with_no_m_flag  s     	779r<   c                     SnS/nSn[        U5       HK  n[        S-  nSU-  nU R                  S[        U5      -   US9nX5-  nUR	                  [        U5      5        MM     U R                  USS	9n[        XX5        g
)zTests UI for a multiple object hashing with no -m flag enabled.

This test indirectly tests the correctness of ProducerThreadMessage in the
UIController.
r   hashr   r   r   rc   r   Trj   N)r   r   rq   rH   r   rs   rr   rT   )	ru   rL   r   rM   r   r   rv   rx   ry   s	            r:   ,test_ui_hash_mutliple_objects_with_no_m_flag3TestUi.test_ui_hash_mutliple_objects_with_no_m_flag  s     KHMJ;"iY&m!!ECFN+8 " :ej4;'   ^^M^>FT;Cr<   c                    U R                   [        R                  :X  a  [        R                  " S5      $ U R                  S[        S9n[        U5      nSS[        4SS[        4/n[        U5         U R                  / SQUSS	9nS
S
S
5        U R                  U[        5        Sn[        S5      n[        U WXV5        g
! , (       d  f       N?= f)zPTests UI output for rewrite and -m flag.

Adapted from test_rewrite_stdin_args.
&Rewrite API is only supported in JSON.   barrg   encryption_keyr   r  decryption_key1)rh   rewrite-k-ITstdinrk   Nrl   )r   r   XMLr   skiprp   r   rs   r   r   rr   AssertObjectUsesCSEKr   rR   ru   rw   	stdin_argr   ry   rL   rM   s          r:   test_ui_rewrite_with_m_flag"TestUi.test_ui_rewrite_with_m_flag  s    
 }}']]CDD""F2F # HJZ I%'79MN%'8:NOQ	2	3~~;$-,0  2f 
4 	i)=>KVJ4A 
4	3   1B>>
Cc                    U R                   [        R                  :X  a  [        R                  " S5      $ U R                  S[        S9n[        U5      nSS[        4SS[        4/n[        U5         U R                  / SQUSS	9nS
S
S
5        U R                  U[        5        Sn[        S5      n[        U WXV5        g
! , (       d  f       N?= f)z\Tests UI output for rewrite and -m flag not enabled.

Adapted from test_rewrite_stdin_args.
r  r  r  r   r  r  )r  r  r   Tr!  Nrl   )r   r   r#  r   r$  rp   r   rs   r   r   rr   r%  r   rT   r&  s          r:   test_ui_rewrite_with_no_m_flag%TestUi.test_ui_rewrite_with_no_m_flag  s    
 }}']]CDD""F2F # HJZ I%'79MN%'8:NOQ	2	3~~5$-,0  2f 
4 	i)=>KVJT6;C 
4	3r*  c           
      8   U R                  5       nU R                  USS9nU R                  USS9nU R                  SSSS[        U5      [        U5      /SS9nX#4 H0  nU R                  S	[        U5      /SS
9nU R	                  SU5        M2     [        XSSS9  g)zzTests a recursive setmeta command with m flag has expected UI output.

Adapted from test_recursion_works on test_setmeta.
   foore   rg   rh   setmeta-hcontent-type:footypeTrj   statr   footyper2   r?   N)rn   rp   rr   rs   rG   rR   ru   re   object1_uriobject2_uriry   obj_uristdouts          r:   test_ui_setmeta_with_m_flag"TestUi.test_ui_setmeta_with_m_flag  s    
 ""$J##zF#KK##zF#KK^^i5[[
 +/  0F  -~~vtG}5T~Jf
mmIv& . 4T:r<   c           	      6   U R                  5       nU R                  USS9nU R                  USS9nU R                  SSS[        U5      [        U5      /SS9nX#4 H0  nU R                  S[        U5      /SS	9nU R	                  S
U5        M2     [        XSSS9  g)z}Tests a recursive setmeta command with no m flag has expected UI output.

Adapted from test_recursion_works on test_setmeta.
r/  r0  r1  r2  r3  Trj   r4  r   r5  r2   r?   N)rn   rp   rr   rs   rG   rT   r6  s          r:   test_ui_setmeta_with_no_m_flag%TestUi.test_ui_setmeta_with_no_m_flag(  s    
 ""$J##zF#KK##zF#KK^^4/[[
 +/  0F  -~~vtG}5T~Jf
mmIv& . T1t<r<   c                    / SQn/ SQn[        U R                  SS95      nU R                  X/-   SS9nU R                  UR	                  [
        5      S9nU R                  USU/-   SS9n[        XS	SS
9  U R                  X/-   SS9nU R                  X%U/-   SS9n[        XS	SS
9  U R                  X/-   SS9nU R                  XG5        U R                  XH5        g)zaTests UI output for an ACL command with m flag enabled.

Adapted from test_set_valid_acl_object.
)rh   aclget)rh   rA  setr/  r   Tr   public-readrj   rl   r?   N)	rs   rp   rr   rq   r   r'   rR   assertNotEqualr   	ru   get_acl_prefixset_acl_prefixr9  
acl_stringinpathry   acl_string2acl_string3s	            r:   test_ui_acl_with_m_flagTestUi.test_ui_acl_with_m_flag<  s    
 *N)N4$$f$56G :$OJ  **;*;D*A BF^^NmW-EE*.  0F4T:..)!;4.PK^^Ng->>*.  0F4T:..)!;4.PK
0Z-r<   c                    SS/nSS/n[        U R                  SS95      nU R                  X/-   SS9nU R                  UR	                  [
        5      S9nU R                  USU/-   SS	9n[        XS
SS9  U R                  X/-   SS9nU R                  X%U/-   SS	9n[        XS
SS9  U R                  X/-   SS9nU R                  XG5        U R                  XH5        g)zeTests UI output for an ACL command with m flag not enabled.

Adapted from test_set_valid_acl_object.
rA  rB  rC  r/  r   Tr   rD  rj   rl   r?   N)	rs   rp   rr   rq   r   r'   rT   rE  r   rF  s	            r:   test_ui_acl_with_no_m_flag!TestUi.test_ui_acl_with_no_m_flagR  s   
 U^NU^N4$$f$56G :$OJ  **;*;D*A BF^^NmW-EE*.  0FT1t<..)!;4.PK^^Ng->>*.  0FT1t<..)!;4.PK
0Z-r<   c                   ^ ^^^ T(       d  / mT R                  5       mT R                  5       mT R                  TSSS9  T R                  TSSSS9  T R                  TSS	S9  T R                  TS
SSS9  T R                  TSSS9  T R                  TSSS9  T R                  TSSS9  T R                  TS
SSS9  [        [        SSS9UUUU 4S j5       nU" 5         g)zHelper class to test UI output for rsync command.

Args:
  gsutil_flags: List of flags to run gsutil with, or None.

Adapted from test_bucket_to_bucket in test_rsync.
obj1s   obj1rd   .obj2s   .obj2
   )re   rf   rg   mtimezsubdir/obj3s   subdir/obj3obj6s   obj6_d   s   .OBJ2obj4s   obj4zsubdir/obj5s   subdir/obj5s   obj6r   rl   )triestimeout_secsc            
        > TS[        T5      [        T5      /-   n T	R                  U SS9nSn[        S5      [        S5      -   [        S5      -   n[        T	XU5        [	        [        T5      T	R                  T5      5      n[	        [        T5      T	R                  T5      5      nT	R                  U[        / SQ5      5        T	R                  U[        / S	Q5      5        T	R                  ST	R                  S
[        TS5      /SS95        T	R                  ST	R                  S
[        TS5      /SS95        T	R                  ST	R                  S
[        TS5      /SS95        g)zTests rsync works as expected.rsyncTrj   r   rS  rT  obj6_)/obj1/.obj2z/subdir/obj3/obj6)r_  r`  z/obj4z/subdir/obj5ra  r   r   rW  N)rs   rr   r   rT   r   FlatListBucketr   rC  )
r   ry   rL   rM   listing1listing2bucket1_uribucket2_urir   ru   s
         r:   _Check1>TestUi._test_ui_rsync_bucket_to_bucket_helper.<locals>._Check1  ss    "tK0;'))k ~~k~>fkv;W-G<jtV*Ek*D,?,?,LMhk*D,?,?,LMh
xGHJ
 
CMNP
 

..%k7!;<'+  -. 

..%k7!;<'+  -. 

..%k6!:;'+  -.r<   N)rn   rp   r-   AssertionError)ru   r   rg  re  rf  s   `` @@r:   &_test_ui_rsync_bucket_to_bucket_helper-TestUi._test_ui_rsync_bucket_to_bucket_helperh  s?    l ##%K##%K"(&  ( 	")'    	"/-  / 	"('  !
 	")'  ) 	"(&  ( 	"/-  / 	"(&  ! >3!. 4!.F Ir<   c                 $    U R                  S/S9  g)zATests UI output for rsync with -m flag enabled works as expected.rh   r   Nrj  r   s    r:   *test_ui_rsync_bucket_to_bucket_with_m_flag1TestUi.test_ui_rsync_bucket_to_bucket_with_m_flag  s    //dV/Dr<   c                 $    U R                  5         g)zETests UI output for rsync with -m flag not enabled works as expected.Nrm  r   s    r:   -test_ui_rsync_bucket_to_bucket_with_no_m_flag4TestUi.test_ui_rsync_bucket_to_bucket_with_no_m_flag  s    //1r<   r>   )N))__name__
__module____qualname____firstlineno____doc__rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   
skipUnlessr%   r  r  r  r  r(  r,  r;  r>  rM  rP  rj  rn  rq  __static_attributes__r>   r<   r:   r_   r_      sx   +F H DF M2O4M.O0 23D 4D8 23F 4F< =A5FnPP#G+R 23F 4F 233 43
 +->@12HF 3@HFT 23M 4M
 23: 4:
D(B,D,;(=(.,.,SjE2r<   r_   c                   \    \ rS rSrSr\rSrS rS r	S r
S rS rS	 rS
 rS rS rS rSrg)TestUiUnitTestsi  zUnit tests for UI functions.'  c                    [         R                   " 5       n[        R                  " 5       nU R                  n[	        SSSSUS9n[        XU5      nSnSn[        U[        XgU5      5        U R                  SSS9n[        U[        [        [        U5      5      SUS-   [        [        R                  S	S
95        [        U[        [        [        U5      5      SUS-   [        [        R                  SS
95        [        U[        5        [        U5        UR!                  5       n	SU< S[#        U5      < S3n
U R%                  X5        U R%                  S['        U5      -   U	5        U R)                  S['        US-   5      -   U	5        g)z3Tests if a seek ahead message is correctly printed.r   custom_timerU  i   @r   r/  r   NFsizemessage_typefinished   Tz*Estimated work for this command: objects: z, total size: 
rD   rl   )QueuesixStringIO
start_timer#   r$   r+   r   rq   r   r   rs   r   FILE_UPLOADr,   r;   getvaluer/   rG   rH   rW   )ru   status_queuestreamr  ui_controllerr8   rL   rM   rx   rK   expected_messages              r:   test_ui_seek_ahead_message*TestUiUnitTests.test_ui_seek_ahead_message  sg   ;;=L\\^FJ Aq!DM}=IKJ,*;JOQ *;fME(e5O$!,!8!8"	$% (e5O$!,!8!8!	#$ ,(AB	*ooG 
'
3	5  	MM",MM#K(('2 	S3{Q//9r<   c                    U R                   n[        R                  " 5       n[        R                  " 5       n[	        US9n[        X#U5      n[        U[        SSU5      5        [        S5       HD  nUS-  n[        U[        [        SU-  5      [        SU-  5      U[        R                  S95        MF     [        S5       HE  nUS-  n[        U[        [        SU-  5      [        SU-  5      US[        R                  S	95        MG     [        U[        SSUSS
95        [        U[        U5      5        [        U[        5        [        U5        U R!                  SUR#                  5       5        g)zATests the case where the SeekAheadThread returns total size of 0.r~  rX  r      z
gs://foo%szbar%sr  Tr  r  r  z100/100N)r  r  r  r  r#   r$   r+   r   r   r   r   FILE_DOWNLOADr   r   r,   r;   rG   r  )ru   current_time_msr  r  r  r8   r   s          r:   test_ui_seek_ahead_zero_size,TestUiUnitTests.test_ui_seek_ahead_zero_size  sH   ooO;;=L\\^F _=M}=I,*3?CE3Zo

*<!+;<*7Q;7%#.#<#<>?  3Zo

*<!+;<*7Q;7%##.#<#<	>?  c1oEG ,_(EF,(AB	*MM)V__./r<   c                 6   [         R                   " 5       n[        R                  " 5       n[        5       n[	        XU5      n[        S5       H  n[        US5        M     [        U[        5        [        U5        U R                  SUR                  5       5        g)z;Tests if status queue is empty after processed by UIThread.r|  rc   r   N)r  r  r  r#   r$   r   r+   r,   r;   r   qsize)ru   r  r  r  r8   r   s         r:   test_ui_empty_list"TestUiUnitTests.test_ui_empty_list  so    ;;=L\\^F NM}=I5\L%0 ,(AB	*Q**,-r<   c                    [         R                   " 5       n[        R                  " 5       nU R                  n[	        SSSSUS9n[        X$5      n[        XU5      n[        U[        S[        USS95        U R                  SSS9n[        U[        [        [        U5      5      S	US
-   [        [        R                  SS95        [        U[        [        [        U5      5      S	US-   [        [        R                  SS95        [        U[        US-   5      5        [        U[         5        [#        U5        UR%                  5       n['        XS[        5        g	)a  Tests that UIController correctly integrates messages.

This test ensures UIController correctly shares its state, which is used by
both UIThread and MainThreadUIQueue. There are multiple ways of checking
that. One such way is to create a ProducerThreadMessage on the
MainThreadUIQueue, simulate a upload with messages coming from the UIThread,
and check if the output has the percentage done and number of files
(both happen only when a ProducerThreadMessage or SeekAheadMessage is
called).
r   r~  rl   Tr  r   r/  r   NrU  Fr  r  2   )r  r  r  r  r#   r!   r$   r+   r   r   rq   r   r   rs   r  r   r,   r;   r  rR   )	ru   ui_thread_status_queuer  r  r  main_thread_ui_queuer8   rx   rK   s	            r:    test_ui_controller_shared_states0TestUiUnitTests.test_ui_controller_shared_states)  s4    #[[]\\^FJ Aq!DM,VC/GIaj4HJ *;fME(e5O$!,!8!8"	$% (e5O$!,!8!8!	#$ 0,zB2OP02KL	*ooG4![9r<   c                    [         R                   " 5       n[        R                  " 5       nU R                  n[	        SSSUS9n[        XU5      nU R                  SSS9nU R                  SS	S9nS
 nU" SS[        [        U5      5      5      u  pnnU" SS[        [        U5      5      5      u  pnn[        R                  [        R                  S4[        R                  [        R                  S44 GH  u  nnn[        U[        USUS-   U	US95        [        U[        USUS-   UUS95        [        U
5       H!  n[        U[        USUS-   U-   UUUS95        M#     [        U5       H!  n[        U[        USUS-   U-   UUUS95        M#     Sn[        SUS-   5       H|  nUS-   US-
  X-   -  -   n[        U
5       H$  n[        U[!        U	UU-  U-  UUU-   UUS95        M&     [        U5       H'  n[        U[!        UUU-  U-  UUU
-   U-   UUS95        M)     M~     [        U
5       H"  n[        U[        USUS-   U-   SUUUS95        M$     [        U5       H"  n[        U[        USUS-   U-   SUUUS95        M$     [        U[        USUS-   U	SUS95        [        U[        USUS-   USUS95        [        U["        5        [%        U5        UR'                  5       n[)        S5      nU R+                  US -   U5        XU-  -  nXU-  -  nU R+                  [)        U5      S -   U5        U R+                  [)        U5      S -   U5        [)        UU-   S-  5      nU R-                  UR/                  US -   5      SU-  S-
  5        GM     g)!Tests throughput calculation in the UI.

This test takes two different values, both with a different size and
different number of components, and see if throughput behaves as expected.
r2   rl   r   sliding_throughput_periodupdate_message_periodfirst_throughput_latencyr  r   r/  r   sample-file2.txt   FOOc                     SU -  nX1-  nX1XB4$ )z1Creates size and component_size for a given file.  r>   )alphacomponent_numberr   r  r   s        r:   _CreateFileVariables\TestUiUnitTests.test_ui_throughput_calculation_with_components.<locals>._CreateFileVariablesp  s    E!d.nn>>r<   r   rU     	UploadingDownloadingNrX  r  r     r  )r  component_numr     r1   )r  operation_namei  T)r  r  r  r  iX    r  r  r     /s)r  r  r  r  r#   r$   rq   r   rs   r   r  COMPONENT_TO_UPLOADr  COMPONENT_TO_DOWNLOADr+   r   r   r,   r;   r  r   rG   r   count)ru   r  r  r  r  r8   fpath1fpath2r  size1component_num_file1component_size_file1src_url1size2component_num_file2component_size_file2src_url2file_message_typecomponent_message_typer  r   progress_calls_numberjbase_start_timerK   rX   file1_progressfile2_progressaverage_progresss                                r:   .test_ui_throughput_calculation_with_components>TestUiUnitTests.test_ui_throughput_calculation_with_componentsU  sw    ;;=L\\^F J 178:;-79M }=I  +<v NF  += OF? 'q!';DL'IKU!5 'r1';DL'IKU!5 
	 	 +"A"A		#11#99=JFKA1>
 

h 3& #4	67 

h 3& #4	67 ()!"S(1,1&'%;=	> * ()!"S(1,1&'%;=	> *  Q-12! &+q1u/E/G G *+A  e"669NN&-1,--;=> , *+A  e"669NN&-0CCaG,--;=> ,% 3> ()!"S(1,!%1&'%;=	> * ()!"S(1,!%1&'%;=	> * 

h 3& ##467 

h 3& ##467 L*CD!),!g %Q'd
mmD4K)7L!LMn7L!LMn mm+N;dBGL mm+N;dBGL 1N*a
/1
w}}%5%<=00146MFKr<   c                 P   [         R                   " 5       n[        R                  " 5       nU R                  n[	        SSSUS9n[        XU5      nU R                  SSS9nU R                  SS	S9nS
n[        [        U5      5      n	Sn
[        [        U5      5      n[        R                  S4[        R                  S44 GHc  u  p[        U[        U	SUS-   UUS95        [        U[        USUS-   U
US95        Sn[        SUS-   5       HP  n[        U[        UX-  S-  U	US-   US-  -   US95        [        U[        U
X-  S-  UUS-   US-  -   S-   US95        MR     [        U[        U	SUS-   USUS95        [        U[        USUS-   U
SUS95        [        U[        5        [!        U5        UR#                  5       n[%        S5      nU R'                  US-   U5        X-  nX-  n[%        UU-   S-  5      nU R)                  UR+                  US-   5      SU-  S-
  5        GMf     g)r  r2   rl   r   r  r   r/  r   r  r  r  i  %r  r  Nr  r  i-  r  r1   )r  r  Tr  r  r  )r  r  r  r  r#   r$   rq   r   rs   r   r  r  r+   r   r   r,   r;   r  r   rG   r   r  )ru   r  r  r  r  r8   r  r  r  r  r  r  r  r  r  r  rK   rX   r  r  r  s                        r:   1test_ui_throughput_calculation_with_no_componentsATestUiUnitTests.test_ui_throughput_calculation_with_no_components
  s    ;;=L\\^F J 178:;-79M }=I  +<v NF  += OF
 E#DL1HE#DL1H/:/F/F/:/</:/H/H/</>.?)
 

h 3& #4	67 

h 3& #4	67  Q-12!EIM$&,q1u4+9	;	< 	EIM$&,q1u4q8+9	;	< 3$ 

h 3& ##467 

h 3& ##467 L*CD!),!g %Q'd
mmD4K)5n5n 1N*a
/1
w}}%5%<=00146U.?r<   c                 L   [         R                   " 5       n[        R                  " 5       nU R                  n[	        SSSUS9nSn[        XU5      n[        U5       GH  nUS:  a  [        U[        USU-  -   5      5        M'  US:  aI  US:X  a   [        U[        SSUS-   SU-  -   5      5        [        U[        US	-   S
US-
  -  -   5      5        Mv  US:  aL  US:X  a#  [        U[        SSUS-   S
US-
  -  -   5      5        [        U[        US-   SUS-
  -  -   5      5        M  Xu:  d  M  US:X  a"  [        U[        SSUS-   SUS-
  -  -   SS95        [        U[        US-   US-
  -   5      5        GM     [        U[        US-   5      5        [        U[        5        [        U5        UR                  5       nU R                  SU5        U R!                  SU5        U R!                  SU5        U R!                  SU5        U R#                  UR%                  S5      S5        U R!                  SU5        U R#                  UR%                  S5      S5        U R!                  SU5        U R#                  UR%                  S5      S5        U R!                  SU5        ['        XSSS9  g) zTests that MetadataMessages are being correctly received and processed.

This also tests the relation and hierarchy between different estimation
sources, as represented by the EstimationSource class.
r2   rl   r   r  r  rX  g?   rU  g?r     g333333$@   g      ?g0@Tr     z/130 objectsz/190 objectsz/200 objectsz10.00 objects/sz7.50 objects/sz5.00 objects/sz3.50 objects/sz2.00 objects/sz1.50 objects/sz1.00 objects/sr?   N)r  r  r  r  r#   r$   r   r+   r   r   r   r   r,   r;   r  rW   rG   r   r  rR   )	ru   r  r  r  r  rL   r8   r   rK   s	            r:    test_ui_metadata_message_passing0TestUiUnitTests.test_ui_metadata_message_passingz  s    ;;=L\\^F J 178:;-79M K}=I;	
Sl-j37.BC	Es78
#CJ,<sQw,FGI 	/*r/C1s7O*KL	Ns78
sAzD'83!c'?'JKM 	/*r/C1s7O*KL	N?8
#C$%$.$5q3w$G-134 	l-j2oS.IJ	L;  > ,Z#5E(FG,(AB	*ooG^W-MM.'*MM.'* 	MM#W-W]]#34a8MM"G,W]]#34a8MM"G,W]]#34a8MM"G,4#=r<   c           	         [         R                  " 5       nU R                  n[        US9n[	        X5      nU R                  UR                  S5        [        U[        SSU5      5        U R                  UR                  S5        [        U[        US-   5      5        U R                  UR                  [        5        [        U[        [        S5      SUS-   5      5        U R                  UR                  [        5        g)zTests the correctness of the UI manager.

This test ensures a DataManager is created whenever a data message appears,
regardless of previous MetadataMessages.
r~  Nr2   r   rl   rc   )r  r  r  r#   r!   r   managerr+   r   r   assertIsInstancer"   r   r   r    )ru   r  r  r  r  s        r:   test_ui_managerTestUiUnitTests.test_ui_manager  s     \\^FJ Z8M$V;L]**D1,(=aJ(OP]**D1,
Q(GH-//A(/zA~FH
 	-//=r<   c                 <   U R                  S[        SSS95        U R                  S[        SSS95        U R                  S[        SSS95        U R                  S	[        S
SS95        U R                  S[        SSS95        U R                  S[        SSS95        g)z1Tests the correctness of BytesToFixedWidthString.z	    0.0 Br   rl   )decimal_placesz	   0.00 Br2   z	  2.3 KiBg)\(@z	 1023 KiBg/Az	  1.0 MiBi   z	999.1 MiBg8AN)r   r   r   s    r:   test_ui_BytesToFixedWidthString/TestUiUnitTests.test_ui_BytesToFixedWidthString  s    ["9!A"NO["9!A"NO[,[KM[,]1MO[,WQGI[,_QOQr<   c                 Z   [         R                  " 5       nU R                  n[        SUS9n[	        X5      n[        U[        S[        S5      U5      5        [        U[        [        S5      S U[        R                  S95        UR                  R                  5       n[        U[        S[        S5      [        S5      US-   5      5        UnUR                  R                  5       nU R                  Xe5        [        U[        S[        S5      [        S5      US-   5      5        UnUR                  R                  5       nU R                  Xu5        [        U[        S[        S5      [        S5      US-   5      5        UnUR                  R                  5       nU R                  X5        [        U[        [        S5      S US	-   S
[        R                  S95        Un	UR                  R                  5       nU R                  X5        U R                  X5        U R                  Xe5        g )Nrl   )update_spinner_periodr  rc   r  g333333?r2   r   g      @r3   Tr  )r  r  r  r#   r!   r+   r   r   r   r   r  r  
GetSpinnerr   rE  r   )
ru   r  r  r  r  current_spinnerold_spinner1old_spinner2old_spinner3old_spinner4s
             r:   test_ui_spinnerTestUiUnitTests.test_ui_spinner  s   \\^FJ q-79M$V;L,/3u:zJL(/!,!8!8	:; $++668O3u:';E'B"S(	*+ #L#++668O63u:';E'B"Q	() #L#++668O\33u:';E'B"S(	*+ #L#++668O6(/N!!,!8!8		:; #L#++668O6 	66r<   r>   N)rs  rt  ru  rv  rw  r   upload_sizer  r  r  r  r  r  r  r  r  r  r  ry  r>   r<   r:   r{  r{    sK    $+*-:^ 0D
.*:Xs6jn6`L>\>2Q67r<   r{  )r   F)Wrw  
__future__r   r   r   r   r   r   crcmodr  	six.movesr   r  gslib.cs_api_mapr   gslib.parallel_tracker_filer	   r
   gslib.storage_urlr   gslib.tests.testcaseteststestcase)gslib.tests.testcase.integration_testcaser   gslib.tests.utilr   r   r   rs   r   r   r   r   r   gslib.thread_messager   r   r   r   r   r   gslib.tracker_filer   r   r   r   gslib.ui_controllerr   r    r!   r"   r#   r$   gslib.utils.boto_utilr%   gslib.utils.constantsr&   r'   gslib.utils.copy_helperr(   r)   gslib.utils.hashing_helperr*   &gslib.utils.parallelism_framework_utilr+   r,   gslib.utils.retry_utilr-   gslib.utils.unit_utilr.   r/   r0   ro   r   r   THREAD_WAIT_TIMEr;   rA   rR   rT   rZ   r]   GsUtilIntegrationTestCaser_   GsUtilUnitTestCaser{  r>   r<   r:   <module>r     s0  , % & %  ' 	   
 $ ( 9 F 2 ' ' ? 7 @ 0 1 $ 1 1 % , - 0 6 0 1 0 @ 1 . 7 + 1 / , ( 6 : & ? B - H L ( @ 3 )$q(	  =M /." '($)	-B )*&+	-> -.*/	7F /0,1	7BU2X// U2p^	7h11 ^	7r<   