
    daf!i                        d dl mZ  ej                  d      Z ej                  d      Z ej                  d      Zd dlZd dlZd dl	m
Z
 d dlZd dlZd dlZ G d d      Z G d	 d
e      Z G d d      Z ej"                  eee      \  ZZ G d d      Z ej"                  eeee      \  ZZ G d d      Z ej"                  eee      \  ZZedk(  r ej6                          yy)    )util	importlibzimportlib.machineryzimportlib.utilN)CleanImportc                   2    e Zd ZddZd Zd Zd Zd Zd Zy)	
TestLoaderNc                      || _         || _        y N)pathpackage)selfr
   
is_packages      8/root/Python-3.12.4/Lib/test/test_importlib/test_spec.py__init__zTestLoader.__init__   s    	!    c                      y)Nz<TestLoader object> r   s    r   __repr__zTestLoader.__repr__   s    $r   c                 t    |dk(  r| j                   | j                  S |dk(  r| j                  S t        |      )Nget_filenamer   )r
   _get_filename_is_packageAttributeErrorr   names     r   __getattr__zTestLoader.__getattr__   s>    >!dii&;%%%<###T""r   c                     | j                   S r	   )r
   r   s     r   r   zTestLoader._get_filename    s    yyr   c                     | j                   S r	   )r   r   s     r   r   zTestLoader._is_package#   s    ||r   c                      y r	   r   r   specs     r   create_modulezTestLoader.create_module&   s    r   )NN)	__name__
__module____qualname__r   r   r   r   r   r"   r   r   r   r   r      s     "%#r   r   c                       e Zd ZdZd Zy)	NewLoader   c                 &    | j                   |_        y r	   )EGGSeggsr   modules     r   exec_modulezNewLoader.exec_module.   s    iir   N)r#   r$   r%   r*   r.   r   r   r   r'   r'   *   s    D r   r'   c                   ~    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)ModuleSpecTestsc                    d| _         d| _        | j                  j                  | j                        | _        t               | _        | j                  j                  | j                   | j                        | _	        | j                  j                  | j                   | j                  | j                        | _
        d| j                  _        y Nspamspam.pyoriginTr   r
   r   cache_from_sourcecachedr   loader	machinery
ModuleSpecr!   loc_spec_set_fileattrr   s    r   setUpzModuleSpecTests.setUp4       		ii11$))< lNN--diiE	11$))T[[9= 2 D&*#r   c                    | j                   j                  | j                  | j                        }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y r	   r;   r<   r   r:   assertEqualassertIsr6   loader_statesubmodule_search_locationsr9   assertFalsehas_locationr    s     r   test_defaultzModuleSpecTests.test_default>   s    ~~((DKK@DII.dkk2dkk4(d''.d55t<dkk4(**+r   c                    | j                   j                  | j                  d       }| j                  |j                  | j                         | j	                  |j
                  d        | j	                  |j                  d        | j	                  |j                  d        | j	                  |j                  d        | j	                  |j                  d        | j                  |j                         y r	   )r;   r<   r   rC   rD   r:   r6   rE   rF   r9   rG   rH   r    s     r   test_default_no_loaderz&ModuleSpecTests.test_default_no_loaderI   s    ~~((D9DII.dkk4(dkk4(d''.d55t<dkk4(**+r   c                    | j                   j                  | j                  | j                  d      }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y NFr   rB   r    s     r   test_default_is_package_falsez-ModuleSpecTests.test_default_is_package_falseT   s    ~~((DKK49 ) ; 	DII.dkk2dkk4(d''.d55t<dkk4(**+r   c                    | j                   j                  | j                  | j                  d      }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  g        | j                  |j                  d        | j                  |j                         y NTrN   rB   r    s     r   test_default_is_package_truez,ModuleSpecTests.test_default_is_package_true`   s    ~~((DKK48 ) : 	DII.dkk2dkk4(d''.88"=dkk4(**+r   c                     | j                   j                  | j                  | j                  d      }| j	                  |j
                         d|_        | j                  |j
                         y )N	somewherer5   T)r;   r<   r   r:   rG   rH   
assertTruer    s     r   test_has_location_setterz(ModuleSpecTests.test_has_location_setterl   sX    ~~((DKK0; ) =**+ ))*r   c                      t        t        j                        | j                  | j                  d d dd       }| j                  | j                  |k(         y )NFr   r:   r6   rF   rH   r9   )typesysimplementationr   r:   rU   r!   r   others     r   test_equalityzModuleSpecTests.test_equalitys   sI    (S''(dii0404DH6;04+ 			U*+r   c                      t        t        j                        | j                  | j                  | j
                  d d| j                        }| j                  | j                  |       y )NTrX   )	rY   rZ   r[   r   r:   r
   r9   rC   r=   r\   s     r   test_equality_locationz&ModuleSpecTests.test_equality_location~   sP    (S''(dii0404		DH6:04+ 	.r   c                      t        t        j                        d| j                  d d dd       }| j	                  | j
                  |       y )NhamFrX   )rY   rZ   r[   r:   assertNotEqualr!   r\   s     r   test_inequalityzModuleSpecTests.test_inequality   sD    (S''(e0404DH6;04+ 	DIIu-r   c                      t        t        j                        | j                  | j                        }| j                  | j                  |       y )N)r   r:   )rY   rZ   r[   r   r:   rc   r!   r\   s     r   test_inequality_incompletez*ModuleSpecTests.test_inequality_incomplete   s<    (S''(dii04+ 	DIIu-r   c                     | j                   j                  d| j                        }| j                  |j                  d       y )N	spam.eggsr3   r;   r<   r:   rC   parentr    s     r   test_packagezModuleSpecTests.test_package   s0    ~~((dkkBf-r   c                     | j                   j                  d| j                  d      }| j                  |j                  d       y )Nrh   TrN   ri   r    s     r   test_package_is_packagez'ModuleSpecTests.test_package_is_package   s<    ~~((dkk48 ) : 	k2r   c                     | j                   j                  }d| j                   _        | j                   j                  }| j                  |d        | j                  |d       y )Nthere)r!   r9   rD   rC   )r   beforeafters      r   test_cached_setzModuleSpecTests.test_cached_set   sJ    !!"				  fd#(r   c                     | j                   j                  | j                  | j                        }| j	                  |j
                  d        y r	   )r;   r<   r   r:   rD   r9   r    s     r   test_cached_no_originz%ModuleSpecTests.test_cached_no_origin   s2    ~~((DKK@dkk4(r   c                     | j                   j                  | j                  | j                  | j                        }| j                  |j                  d        y )Nr5   )r;   r<   r   r:   r
   rD   r9   r    s     r   $test_cached_with_origin_not_locationz4ModuleSpecTests.test_cached_with_origin_not_location   sB    ~~((DKK04		 ) ; 	dkk4(r   c                     | j                   j                  | j                        }| j                  | j                  j
                  |       y r	   )r   r8   r
   rC   r=   r9   )r   expecteds     r   test_cached_sourcez"ModuleSpecTests.test_cached_source   s4    99..tyy9--x8r   c                 r    d| j                   _        | j                  | j                   j                  d        y )Nzspam.spamspamspam)r=   r6   rD   r9   r   s    r   !test_cached_source_unknown_suffixz1ModuleSpecTests.test_cached_source_unknown_suffix   s&    2dmm**D1r   c                    t         j                  j                  }d t         j                  _        	 | j                  j                  }|t         j                  _        | j                  |d        y # |t         j                  _        w xY wr	   )rZ   r[   	cache_tagr=   r9   rD   )r   originalr9   s      r   $test_cached_source_missing_cache_tagz4ModuleSpecTests.test_cached_source_missing_cache_tag   sc    %%//'+$	4]]))F+3C(fd# ,4C(s   A/ /Bc                 r    d| j                   _        | j                  | j                   j                  d       y )Nzspam.pyc)r=   r6   rC   r9   r   s    r   test_cached_sourcelessz&ModuleSpecTests.test_cached_sourceless   s(    )--z:r   N)r#   r$   r%   r?   rI   rK   rO   rR   rV   r^   r`   rd   rf   rk   rm   rr   rt   rv   ry   r{   r   r   r   r   r   r0   r0   2   sa    +	,	,
,
,+	,	/	...
3))
)9
2
$;r   r0   )r   r;   c                   ^    e Zd Zed        Zd Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zd Zd Zy)ModuleSpecMethodsTestsc                 .    | j                   j                  S r	   )init
_bootstrapr   s    r   	bootstrapz ModuleSpecMethodsTests.bootstrap   s    yy###r   c                    d| _         d| _        | j                  j                  | j                        | _        t               | _        | j                  j                  | j                   | j                        | _	        | j                  j                  | j                   | j                  | j                        | _
        d| j                  _        y r2   r7   r   s    r   r?   zModuleSpecMethodsTests.setUp   r@   r   c                 t   t               | j                  _        | j                  j	                  | j                        }|t
        j                  | j                  <   | j                  t        |d             | j                  j                  | j                  |       | j                  |j                  d       y )Nr+   r(   )r'   r!   r:   r   module_from_specrZ   modulesr   rG   hasattrr   _execrC   r+   r,   s     r   	test_execz ModuleSpecMethodsTests.test_exec   s{    $;		++DII6!'DII01TYY/a(r   c                    t               | j                  _        t        | j                  j                        5  | j
                  j                  | j                        }t        j                  | j                  j                     }d d d        | j                  j                  d       | j                  |       y # 1 sw Y   8xY wNr(   )r'   r!   r:   r   r   r   _loadrZ   r   rC   r+   rD   )r   loaded	installeds      r   	test_loadz ModuleSpecMethodsTests.test_load   s    $;		( 	4^^))$))4FDIINN3I	4 	a(fi(	4 	4s   AB==Cc                    t                G fddt              } |       | j                  _        t	        | j                  j
                        5  | j                  j                  | j                        }t        j                  | j                  j
                     }d d d        | j                         | j                         y # 1 sw Y   .xY w)Nc                       e Zd Z fdZy)BModuleSpecMethodsTests.test_load_replaced.<locals>.ReplacingLoaderc                 @    t         j                  |j                  <   y r	   )rZ   r   r#   )r   r-   replacements     r   r.   zNModuleSpecMethodsTests.test_load_replaced.<locals>.ReplacingLoader.exec_module  s    /:FOO,r   Nr#   r$   r%   r.   )r   s   r   ReplacingLoaderr     s    ;r   r   )objectr   r!   r:   r   r   r   r   rZ   r   rD   )r   r   r   r   r   s       @r   test_load_replacedz)ModuleSpecMethodsTests.test_load_replaced   s    h	;j 	; +,		( 	4^^))$))4FDIINN3I	4 	fk*i-	4 	4s   ACCc                     G d dt               } |       | j                  _        t        | j                  j                        5  | j                  t              5  | j                  j                  | j                        }d d d        | j                  | j                  j                  t        j                         d d d        y # 1 sw Y   FxY w# 1 sw Y   y xY w)Nc                       e Zd Zd Zy)=ModuleSpecMethodsTests.test_load_failed.<locals>.FailedLoaderc                     t         r	   )RuntimeErrorr,   s     r   r.   zIModuleSpecMethodsTests.test_load_failed.<locals>.FailedLoader.exec_module  s    ""r   Nr   r   r   r   FailedLoaderr     s    #r   r   r   r!   r:   r   r   assertRaisesr   r   r   assertNotInrZ   r   r   r   r   s      r   test_load_failedz'ModuleSpecMethodsTests.test_load_failed  s    	#: 	# (>		( 	:""<0 9--dii89TYY^^S[[9	: 	:9 9	: 	:$   C&C<CC	CCc                     G d dt               } |       | j                  _        t        | j                  j                        5  | j                  t              5  | j                  j                  | j                        }d d d        | j                  | j                  j                  t        j                         d d d        y # 1 sw Y   FxY w# 1 sw Y   y xY w)Nc                       e Zd Zd Zy)EModuleSpecMethodsTests.test_load_failed_removed.<locals>.FailedLoaderc                 D    t         j                  |j                  = t        r	   )rZ   r   r#   r   r,   s     r   r.   zQModuleSpecMethodsTests.test_load_failed_removed.<locals>.FailedLoader.exec_module  s    KK0""r   Nr   r   r   r   r   r     s    #r   r   r   r   s      r   test_load_failed_removedz/ModuleSpecMethodsTests.test_load_failed_removed  s    	#: 	# (>		( 	:""<0 9--dii89TYY^^S[[9	: 	:9 9	: 	:r   c                    t               t        j                         5  t        j                  dt                G fddt
              } |       | j                  _        t        | j                  j                        5  | j                  j                  | j                        }| j                  t        j                  | j                  j                            d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nignorec                       e Zd Z fdZy)UModuleSpecMethodsTests.test_load_legacy_attributes_immutable.<locals>.ImmutableLoaderc                 .    t         j                  |<   S r	   )rZ   r   )r   r   r-   s     r   load_modulezaModuleSpecMethodsTests.test_load_legacy_attributes_immutable.<locals>.ImmutableLoader.load_module'  s    (.CKK%!Mr   N)r#   r$   r%   r   )r-   s   r   ImmutableLoaderr   &  s    "r   r   )r   warningscatch_warningssimplefilterImportWarningr   r!   r:   r   r   r   r   rD   rZ   r   )r   r   r   r-   s      @r   %test_load_legacy_attributes_immutablez<ModuleSpecMethodsTests.test_load_legacy_attributes_immutable"  s    $$& 
	C!!(M:"* "  /0DIITYY^^, C--dii8ckk$))..96BC
	C 
	CC C
	C 
	Cs%   A!C;AC/C;/C8	4C;;Dc                    t               | j                  _        t        | j                  j                        5  | j
                  j                  | j                        }| j
                  j                  | j                  |      }t        j                  | j                  j                     }d d d        | j                  j                  d       | j                  |       | j                  |       y # 1 sw Y   JxY wr   )r'   r!   r:   r   r   r   r   r   rZ   r   rC   r+   rD   )r   r   reloadedr   s       r   test_reloadz"ModuleSpecMethodsTests.test_reload2  s    $;		( 	4^^))$))4F~~++DIIv>HDIINN3I	4
 	a(h'i(	4 	4s   A3C55C>c                    t               | j                  _        t        | j                  j                        5  | j
                  j                  | j                        }d|_        | j
                  j                  | j                  |      }d d d        | j                  j                  d       | j                  |       y # 1 sw Y   8xY w)N   r(   )r'   r!   r:   r   r   r   r   r+   r   rC   rD   r   r   r   s      r   test_reload_modifiedz+ModuleSpecMethodsTests.test_reload_modified=  s    $;		( 	?^^))$))4FFK~~++DIIv>H	?
 	a(h'	? 	?s   ACCc                    t               | j                  _        t        | j                  j                        5  | j
                  j                  | j                        }d|_        | j
                  j                  | j                  |      }d d d        | j                  j                         | j                  |       y # 1 sw Y   7xY wNF)r'   r!   r:   r   r   r   r   	availabler   rG   rD   r   s      r   test_reload_extra_attributesz3ModuleSpecMethodsTests.test_reload_extra_attributesG  s    $;		( 	?^^))$))4F$F~~++DIIv>H	?
 	))*h'	? 	?s   ACCc                 ^   t               | j                  _        t        | j                  j                        5  | j
                  j                  | j                        }d|_        |`|`	|`
| j
                  j                  | j                  |       d d d        | j                  j                  | j                  j                         | j                  |j                  | j                  j                         | j                  |j                  | j                  j                         | j                  |j                  | j                         | j                  t!        |d             | j                  t!        |d             | j                  t!        |d             y # 1 sw Y   xY w)Nrb   __path____file__
__cached__)r'   r!   r:   r   r   r   r   r#   
__loader____package____spec__r   rC   rD   rj   rG   r   )r   r   s     r   test_reload_init_module_attrsz4ModuleSpecMethodsTests.test_reload_init_module_attrsQ  s.   $;		( 	4^^))$))4F#FO!"NN  F3	4 	$))..9f'')9)9:++TYY-=-=>footyy1454567	4 	4s   AF""F,N)r#   r$   r%   propertyr   r?   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      sL    $ $+)).:	:C 	)((8r   r   )r   r   r;   c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)FactoryTestsc                 6   d| _         t        j                  j                  d      | _        | j                  j                  | j                        | _        t               | _        t        | j                        | _	        t        | j                  d      | _
        y )Nr3   r4   T)r   osr
   abspathr   r8   r9   r   r:   
fileloader	pkgloaderr   s    r   r?   zFactoryTests.setUpl  sb    	GGOOI.	ii11$))< l$TYY/#DIIt4r   c                    | j                   j                  | j                  | j                        }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y r	   r   spec_from_loaderr   r:   rC   rD   r6   rE   rF   r9   rG   rH   r    s     r   test_spec_from_loader_defaultz*FactoryTests.test_spec_from_loader_defaultv  s    yy))$))T[[ADII.dkk2dkk4(d''.d55t<dkk4(**+r   c                     G d d      } |       }| j                   j                  | j                  |      }| j                  |j                  | j                         | j                  |j                  |       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y )Nc                       e Zd Zd Zy)NFactoryTests.test_spec_from_loader_default_with_bad_is_package.<locals>.Loaderc                     t         r	   ImportErrorr   s     r   r   zYFactoryTests.test_spec_from_loader_default_with_bad_is_package.<locals>.Loader.is_package      !!r   Nr#   r$   r%   r   r   r   r   Loaderr         "r   r   )r   r   r   rC   r:   rD   r6   rE   rF   r9   rG   rH   r   r   r:   r!   s       r   1test_spec_from_loader_default_with_bad_is_packagez>FactoryTests.test_spec_from_loader_default_with_bad_is_package  s    	" 	" yy))$))V<DII.f-dkk4(d''.d55t<dkk4(**+r   c                    d}| j                   j                  | j                  | j                  |      }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  |       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y )Nzsomewhere over the rainbowr5   r   r   r6   r!   s      r   test_spec_from_loader_originz)FactoryTests.test_spec_from_loader_origin  s    -yy))$))T[[17 * 9 	DII.dkk2dkk6*d''.d55t<dkk4(**+r   c                    | j                   j                  | j                  | j                  d      }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y rM   r   r    s     r   &test_spec_from_loader_is_package_falsez3FactoryTests.test_spec_from_loader_is_package_false  s    yy))$))T[[5: * < 	DII.dkk2dkk4(d''.d55t<dkk4(**+r   c                    | j                   j                  | j                  | j                  d      }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  g        | j                  |j                  d        | j                  |j                         y rQ   r   r    s     r   %test_spec_from_loader_is_package_truez2FactoryTests.test_spec_from_loader_is_package_true  s    yy))$))T[[59 * ; 	DII.dkk2dkk4(d''.88"=dkk4(**+r   c                    d}| j                   j                  | j                  | j                  |d      }| j	                  |j                  | j                         | j	                  |j                  | j                         | j                  |j                  |       | j                  |j                  d        | j	                  |j                  g        | j                  |j                  d        | j                  |j                         y )Nzwhere the streets have no nameT)r6   r   r   r   s      r   +test_spec_from_loader_origin_and_is_packagez8FactoryTests.test_spec_from_loader_origin_and_is_package  s    1yy))$))T[[17D * J 	DII.dkk2dkk6*d''.88"=dkk4(**+r   c                    t        d      }| j                  j                  | j                  |      }| j	                  |j                  | j                         | j	                  |j
                  |       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y rM   r   r   r   r   rC   r:   rD   r6   rE   rF   r9   rG   rH   r   r:   r!   s      r   2test_spec_from_loader_is_package_with_loader_falsez?FactoryTests.test_spec_from_loader_is_package_with_loader_false  s    u-yy))$))V<DII.f-dkk4(d''.d55t<dkk4(**+r   c                    t        d      }| j                  j                  | j                  |      }| j	                  |j                  | j                         | j	                  |j
                  |       | j                  |j                  d        | j                  |j                  d        | j	                  |j                  g        | j                  |j                  d        | j                  |j                         y rQ   r   r   s      r   1test_spec_from_loader_is_package_with_loader_truez>FactoryTests.test_spec_from_loader_is_package_with_loader_true  s    t,yy))$))V<DII.f-dkk4(d''.88"=dkk4(**+r   c                 :   | j                   j                  | j                  | j                        }| j	                  |j                  | j                         | j	                  |j
                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  | j                         | j                  |j                         y r	   r   r   r   r   rC   r:   r6   r
   rD   rE   rF   r9   rU   rH   r    s     r   .test_spec_from_loader_default_with_file_loaderz;FactoryTests.test_spec_from_loader_default_with_file_loader  s    yy))$))T__EDII.doo6dii0d''.d55t<dkk2))*r   c                 >   | j                   j                  | j                  | j                  d      }| j	                  |j                  | j                         | j	                  |j
                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  | j                         | j                  |j                         y rM   r   r    s     r   6test_spec_from_loader_is_package_false_with_fileloaderzCFactoryTests.test_spec_from_loader_is_package_false_with_fileloader  s    yy))$))T__5: * < 	DII.doo6dii0d''.d55t<dkk2))*r   c                 z   | j                   j                  | j                  | j                  d      }| j	                  |j                  | j                         | j	                  |j
                  | j                         | j	                  |j                  | j                         | j                  |j                  d        t        j                         x}dk7  r|nd}| j	                  |j                  |g       | j	                  |j                  | j                         | j                  |j                         y )NTrN   / )r   r   r   r   rC   r:   r6   r
   rD   rE   r   getcwdrF   r9   rU   rH   r   r!   cwdlocations       r   5test_spec_from_loader_is_package_true_with_fileloaderzBFactoryTests.test_spec_from_loader_is_package_true_with_fileloader  s    yy))$))T__59 * ; 	DII.doo6dii0d''."$))+-3#532888*Edkk2))*r   c                 ,   | j                   j                  | j                  | j                        }| j	                  |j                  | j                         | j                   j                  j
                  d   }| j                  |j                  |       | j	                  |j                  j                  | j                         | j	                  |j                  j                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  | j                         | j                  |j                         y )NSourceFileLoader)r   spec_from_file_locationr   r
   rC   __globals__assertIsInstancer:   r6   rD   rE   rF   r9   rU   rH   )r   r!   r  s      r   $test_spec_from_file_location_defaultz1FactoryTests.test_spec_from_file_location_default   s   yy00DIIFDII.  99<<HHI[\dkk+;<))4995))4995dii0d''.d55t<dkk2))*r   c                     | j                   j                  | j                  t        j                  | j
                              }| j                  |j                  | j
                         y r	   )r   r  r   pathlibPurePathr
   rC   r6   r    s     r   *test_spec_from_file_location_path_like_argz7FactoryTests.test_spec_from_file_location_path_like_arg  sG    yy00181A1A$))1LNdii0r   c                 r    | j                   j                  | j                        }| j                  |d        y r	   r   r  r   rD   r    s     r   5test_spec_from_file_location_default_without_locationzBFactoryTests.test_spec_from_file_location_default_without_location  s(    yy00;dD!r   c                 t    | j                   j                  | j                  d      }| j                  |d        y )Nrh   r  r    s     r   /test_spec_from_file_location_default_bad_suffixz<FactoryTests.test_spec_from_file_location_default_bad_suffix  s*    yy00KHdD!r   c                 <   | j                   j                  | j                  | j                        }| j	                  |j                  | j                         | j	                  |j
                  | j                         | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  | j                         | j                  |j                         y Nr:   )r   r  r   r   rC   r:   r6   r
   rD   rE   rF   r9   rU   rH   r    s     r   /test_spec_from_file_location_loader_no_locationz<FactoryTests.test_spec_from_file_location_loader_no_location   s    yy008< 1 I 	DII.doo6dii0d''.d55t<dkk2))*r   c                    | j                   j                  | j                  | j                        }| j	                  |j                  | j                         | j	                  |j                  | j                         | j	                  |j
                  d       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y )Nr  	<unknown>)r   r  r   r:   rC   r6   rD   rE   rF   r9   rU   rH   r    s     r   ?test_spec_from_file_location_loader_no_location_no_get_filenamezLFactoryTests.test_spec_from_file_location_loader_no_location_no_get_filename,  s    yy008< 1 E 	DII.dkk2k2d''.d55t<dkk4())*r   c                     G d d      } |       }| j                   j                  | j                  |      }| j                  |j                  | j                         | j                  |j                  |       | j                  |j
                  d       | j                  |j                  d        | j                  |j                  d        | j                  |j                  d        | j                  |j                         y )Nc                       e Zd Zd Zy)]FactoryTests.test_spec_from_file_location_loader_no_location_bad_get_filename.<locals>.Loaderc                     t         r	   r   r   s     r   r   zjFactoryTests.test_spec_from_file_location_loader_no_location_bad_get_filename.<locals>.Loader.get_filename:  r   r   N)r#   r$   r%   r   r   r   r   r   r  9  r   r   r   r  r  )r   r  r   rC   r:   r6   rD   rE   rF   r9   rU   rH   r   s       r   @test_spec_from_file_location_loader_no_location_bad_get_filenamezMFactoryTests.test_spec_from_file_location_loader_no_location_bad_get_filename8  s    	" 	" yy0060JDII.f-k2d''.d55t<dkk4())*r   c                 T   | j                   j                  | j                  | j                  | j                  d       }| j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j                  |j                  | j                         | j                  |j                         y )Nr:   rF   r   r  r   r
   r   rC   r:   r6   rD   rE   rF   r9   rU   rH   r    s     r   &test_spec_from_file_location_smsl_nonez3FactoryTests.test_spec_from_file_location_smsl_noneG  s    yy00DII.2ooBF 1 H 	DII.doo6dii0d''.d55t<dkk2))*r   c                    | j                   j                  | j                  | j                  | j                  g       }| j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  d        t        j                         x}dk7  r|nd}| j                  |j                  |g       | j                  |j                  | j                         | j                  |j                         y )Nr  r   r   )r   r  r   r
   r   rC   r:   r6   rD   rE   r   r   rF   r9   rU   rH   r   s       r   'test_spec_from_file_location_smsl_emptyz4FactoryTests.test_spec_from_file_location_smsl_emptyT  s    yy00DII.2ooBD 1 F 	DII.doo6dii0d''."$))+-3#532888*Edkk2))*r   c                 X   | j                   j                  | j                  | j                  | j                  dg      }| j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  d        | j                  |j                  dg       | j                  |j                  | j                         | j                  |j                         y )Nr+   r  r  r    s     r   +test_spec_from_file_location_smsl_not_emptyz8FactoryTests.test_spec_from_file_location_smsl_not_emptyb  s    yy00DII.2ooCI( 1 L 	DII.doo6dii0d''.886(Cdkk2))*r   c                    | j                   j                  | j                  | j                  | j                        }| j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  d        t        j                         x}dk7  r|nd}| j                  |j                  |g       | j                  |j                  | j                         | j                  |j                         y )Nr  r   r   )r   r  r   r
   r   rC   r:   r6   rD   rE   r   r   rF   r9   rU   rH   r   s       r   )test_spec_from_file_location_smsl_defaultz6FactoryTests.test_spec_from_file_location_smsl_defaulto  s    yy00DII.2nn 1 > 	DII.dnn5dii0d''."$))+-3#532888*Edkk2))*r   c                 L    G d d      } |       }| j                   j                  | j                  | j                  |      }| j	                  |j                  | j                         | j	                  |j
                  |       | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  | j                         | j                  |j                         y )Nc                       e Zd Zd Zy)RFactoryTests.test_spec_from_file_location_smsl_default_not_package.<locals>.Loaderc                      yr   r   r   s     r   r   z]FactoryTests.test_spec_from_file_location_smsl_default_not_package.<locals>.Loader.is_package~  s    r   Nr   r   r   r   r   r)  }  s    r   r   r  r   r  r   r
   rC   r:   r6   rD   rE   rF   r9   rU   rH   r   s       r   5test_spec_from_file_location_smsl_default_not_packagezBFactoryTests.test_spec_from_file_location_smsl_default_not_package|  s    	 	 yy00DII8> 1 @ 	DII.f-dii0d''.d55t<dkk2))*r   c                 R   | j                   j                  | j                  | j                  | j                        }| j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j                  |j                  | j                         | j                  |j                         y r  r  r    s     r   7test_spec_from_file_location_smsl_default_no_is_packagezDFactoryTests.test_spec_from_file_location_smsl_default_no_is_package  s    yy00DII.2oo 1 ? 	DII.doo6dii0d''.d55t<dkk2))*r   c                 L    G d d      } |       }| j                   j                  | j                  | j                  |      }| j	                  |j                  | j                         | j	                  |j
                  |       | j	                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j	                  |j                  | j                         | j                  |j                         y )Nc                       e Zd Zd Zy)UFactoryTests.test_spec_from_file_location_smsl_default_bad_is_package.<locals>.Loaderc                     t         r	   r   r   s     r   r   z`FactoryTests.test_spec_from_file_location_smsl_default_bad_is_package.<locals>.Loader.is_package  r   r   Nr   r   r   r   r   r1    r   r   r   r  r+  r   s       r   8test_spec_from_file_location_smsl_default_bad_is_packagezEFactoryTests.test_spec_from_file_location_smsl_default_bad_is_package  s    	" 	" yy00DII8> 1 @ 	DII.f-dii0d''.d55t<dkk2))*r   c                    | j                   j                  | j                  t        j                  j                  | j                        | j                        }| j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  | j                         | j                  |j                  d        | j                  |j                  d        | j                  |j                  | j                         | j                  |j                         y r  )r   r  r   r   r
   basenamer   rC   r:   r6   rD   rE   rF   r9   rU   rH   r    s     r   *test_spec_from_file_location_relative_pathz7FactoryTests.test_spec_from_file_location_relative_path  s    yy00GGTYY' 1 A 	DII.doo6dii0d''.d55t<dkk2))*r   N)r#   r$   r%   r?   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r   r"  r$  r&  r,  r.  r3  r6  r   r   r   r   r   j  s    5	,,,
,
,,
,
,	+
+++"1
"
"

+
+++++++ 
++ 
+r   r   __main__)test.test_importlibr   	test_utilimport_importlibr   r;   os.pathr   r	  test.support.import_helperr   unittestrZ   r   r   r'   r0   	test_bothFrozen_ModuleSpecTestsSource_ModuleSpecTestsr   Frozen_ModuleSpecMethodsTestsSource_ModuleSpecMethodsTestsr   Frozen_FactoryTestsSource_FactoryTestsr#   mainr   r   r   <module>rF     s   1!y!!+.&I&&'<=	!y!!"23   2  
  4 
  `; `;J YtyIG8 G8X Y/d#,.
H+ H+X
 YDIF zHMMO r   