o
    E6d                    @   s  d dl Z d dlZd dlZddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddlm!Z! ddl"m#Z# ddl"m$Z$ ddlm%Z% dd lm&Z& dd!l'm(Z( dd"l)m*Z* dd#lm+Z+ dd$lm,Z, dd%lm-Z- dd&lm.Z. dd'lm/Z/ d(\Z0Z1G d)d* d*ej2Z3G d+d, d,e3Z4G d-d. d.ej2Z5G d/d0 d0ej2Z6d1d2 Z7G d3d4 d4e,e3Z8G d5d6 d6ej9Z:G d7d8 d8e+ej9Z;G d9d: d:ej2Z<G d;d< d<ej=Z>G d=d> d>ej2Z?G d?d@ d@ej2Z@dAZAdS )B    N   )config)engines)eq_)expect_raises)expect_raises_message)expect_warnings)fixtures)is_)get_temp_table_name)temp_table_keyword_argsColumn)Table   )event)
ForeignKey)func)Identity)inspect)Integer)MetaData)String)testing)types)	Inspector)
ObjectKind)ObjectScope)NoSuchTableError)UnreflectableTableError)DDL)Index)quoted_name)BLANK_SCHEMA)ComparesIndexes)ComparesTables)is_false)is_true)mockNNc                   @   s   e Zd Zedd ZdS )OneConnectionTablesTestc                 C   s2   t jjjrddlm} tjt|j	dddS t j
S )Nr   )poolclass)Z	poolclassscope)options)r   requirementsZindependent_connectionsenabled
sqlalchemyr+   r   testing_enginedictZ
StaticPooldb)clsr+    r6   C:\Users\jesus\OneDrive\Desktop\erpjis_fastapi\backend\jisbackend\Lib\site-packages\sqlalchemy/testing/suite/test_reflection.py
setup_bind1   s   
z"OneConnectionTablesTest.setup_bindN)__name__
__module____qualname__classmethodr8   r6   r6   r6   r7   r*   0   s    r*   c                   @   s   e Zd ZdZedd Zedd Zedd Zedd	 Zd
d Z	dd Z
ejjdd Zejjdd Zejjdd Zejjdd Zejjejjejjdd Zejjejjdd ZdS )HasTableTestTc                 C   s   t d|tdtddtdtd tjjjr*t d|tdtddtdtdtj	d tjj
r3| | tjjjr?| | d S d S )	N
test_tableidTprimary_keydata2   test_table_sschema)r   r   r   r   r   requiresschemasr0   r   test_schemaview_reflectiondefine_viewshas_temp_tabledefine_temp_tablesr5   metadatar6   r6   r7   define_tablesC   s&   


zHasTableTest.define_tablesc                 C   st   d}t |dt| t |dtd tjjjr8dtjtjf }t |dt| t |dtdtj  d S d S )Nz1CREATE VIEW vv AS SELECT id, data FROM test_tableafter_createbefore_dropzDROP VIEW vvz9CREATE VIEW %s.vv AS SELECT id, data FROM %s.test_table_szDROP VIEW %s.vv)	r   listenr    r   rG   rH   r0   r   rI   )r5   rO   queryr6   r6   r7   rK   Y   s"   
zHasTableTest.define_viewsc                 C      t ttjdtj S NZ	user_tmp_r   r   r4   identr5   r6   r6   r7   temp_table_nameo      zHasTableTest.temp_table_namec              	   C   s   t ttj}|  }t||tdtjddtdtdfi |}t	j
jjrBt	j
jjrDt|dtdtj  t|dtd	 d S d S d S )
Nr?   Tr@   namerC   rQ   =create temporary view user_tmp_v as select * from user_tmp_%srR   drop view user_tmp_v)r   r   r4   rZ   r   r   saINTVARCHARr   rG   rJ   r0   temporary_viewsr   rS   r    rX   r5   rO   kw
table_nameuser_tmpr6   r6   r7   rM   u   s2   zHasTableTest.define_temp_tablesc                 C   sl   t j '}tt jj|d tt jj|d tt jj|d W d    d S 1 s/w   Y  d S )Nr>   rD   nonexistent_table)r   r4   beginr'   dialect	has_tabler&   selfconnr6   r6   r7   test_has_table   s
   "zHasTableTest.test_has_tablec              	   C   s   t tj}t|d td|tdt}t|d |	tj zt|d |
  t|d W |tj d S |tj w )Nr>   Z	new_tablecol)r   r   r4   r'   rj   r   r   r   r&   createclear_cachedrop)rl   rO   inspntr6   r6   r7   test_has_table_cache   s   
z!HasTableTest.test_has_table_cachec                 C   s~   t j 0}tt jjj|dt jd tt jjj|dt jd tt jjj|dt jd W d    d S 1 s8w   Y  d S )Nr>   rE   rD   rg   )r   r4   rh   r&   ri   rj   rI   r'   rk   r6   r6   r7   test_has_table_schema   s"   "z"HasTableTest.test_has_table_schemac                 C   sH   t j }tt jjj|ddd W d    d S 1 sw   Y  d S )Nr>   Znonexistent_schemarE   )r   r4   rh   r&   ri   rj   rk   r6   r6   r7   !test_has_table_nonexistent_schema   s   "z.HasTableTest.test_has_table_nonexistent_schemac                 C      t |}t|d d S Nvvr   r'   rj   rl   
connectionrs   r6   r6   r7   test_has_table_view   s   z HasTableTest.test_has_table_viewc                 C   s"   t |}|  }t|| d S N)r   rZ   r'   rj   )rl   r}   rs   rZ   r6   r6   r7   test_has_table_temp_table   s   z&HasTableTest.test_has_table_temp_tablec                 C   rx   N
user_tmp_vr{   r|   r6   r6   r7   test_has_table_temp_view   s   z%HasTableTest.test_has_table_temp_viewc                 C   s   t |}t|dtj d S ry   )r   r'   rj   r   rI   r|   r6   r6   r7   test_has_table_view_schema   s   z'HasTableTest.test_has_table_view_schemaN)r9   r:   r;   __backend__r<   rP   rK   rZ   rM   rn   ru   r   rG   rH   rv   rw   viewsr~   rL   r   rJ   rb   r   r   r6   r6   r6   r7   r=   @   s6    







r=   c                   @   sT   e Zd ZdZedd ZejddddZdd	 Z	ed
d Z
ejjedd ZdS )HasIndexTestTc              	   C   s   t d|tdtddtdtdtdtd}td|jj tjj	j
r@t d|tdtddtdtdtjd	}td
|jj d S d S )Nr>   r?   Tr@   rB   rC   data2my_idxrE   my_idx_s)r   r   r   r   r!   crB   r   rG   rH   r0   r   rI   )r5   rO   ttr6   r6   r7   rP      s$   
zHasIndexTest.define_tablesri   	inspectorkindargnamesc                    s   |dkr
 fddS t  jS )Nri   c                     s   t jjj g| R i |S r   )r   r4   ri   	has_index)akrm   r6   r7   <lambda>       z)HasIndexTest._has_index.<locals>.<lambda>)r   r   )rl   r   rm   r6   r   r7   
_has_index   s   
zHasIndexTest._has_indexc              	   C   s$  |  ||}|ddsJ |ddrJ |ddrJ |ddr"J |ddr)J |ddr0J td| jjjj}td|td	ttdd	}|	| |	| z6|d
krh|ddr\J |ddrcJ |j
  |dddu sqJ |dddu szJ W || || d S || || w )Nr>   r   r   rg   Znonexistent_idxZmy_idx_2Ztest_table_2Zmy_idx_3foor   T)r   r!   tablesr>   r   r   r   r   r   rp   __self__rq   rr   )rl   r   r}   rO   methidxtblr6   r6   r7   test_has_index   s6   




zHasIndexTest.test_has_indexc                 C   s`   |  ||}|ddtjdsJ |ddtjdrJ |ddtjdr$J |ddtjdr.J d S )Nr>   r   rE   r   rg   Znonexistent_idx_s)r   r   rI   )rl   r   r}   r   r6   r6   r7   test_has_index_schema  s   
z"HasIndexTest.test_has_index_schemaN)r9   r:   r;   r   r<   rP   r   combinationsr   r   r   rG   rH   r   r6   r6   r6   r7   r      s    

r   c                   @   s   e Zd ZdZdZedd Zdd Zedd Zee	j
jd	d
 Zedd Zedd Zedd Zedd Zee	j
jdd Zee	j
jdd Zee	j
jdd ZdS )QuotedNameArgumentTestonceTc                 C   s  t d|tdttdtdtdtdtdttjdddtd	dtjdd
dtjdgdgddtj	dddddd t
jjjr}t d|tdttdtdtdtdtdttjdddtddtjdddtjdgdgddtj	dddddd t d|tdtddtdtdd t
jjjrt
jjjrddg}ndg}|D ]4}dtjjjd| tjjj|f }t|dt| t|dtd tjjjd|   qd S d S )!Nquote ' oner?   r\   rC   rB   Z
related_idzpk quote ' oner\   zix quote ' onezuq quote' onez
related.idzfk quote ' onezname != 'foo'zck quote ' onezquote ' one commentT)commenttest_needs_fkquote " twozpk quote " twozix quote " twozuq quote" twozfk quote " twozck quote " two zquote " two commentrelatedr@   r   z"CREATE VIEW %s AS SELECT * FROM %sview %srQ   rR   zDROP VIEW %s)r   r   r   r   r_   PrimaryKeyConstraintr!   UniqueConstraintForeignKeyConstraintCheckConstraintr   rG   symbol_names_w_double_quoter0   view_column_reflectionr   r4   ri   Zidentifier_preparerquoter   rS   r    )r5   rO   namesr\   rT   r6   r6   r7   rP   &  s   









z$QuotedNameArgumentTest.define_tablesc                 C   s   t ddt jjf| S )N)r   r   )r   r   rG   r   )fnr6   r6   r7   quote_fixturesy  s   
z%QuotedNameArgumentTest.quote_fixturesc                 C   sh   t tj}tjjjr||}tt	|t
 d S tt ||}W d    d S 1 s-w   Y  d S r   )r   r   r4   r   rG   reflect_table_optionsr0   get_table_optionsr'   
isinstancer3   r   NotImplementedError)rl   r\   rs   resr6   r6   r7   test_get_table_options  s   



"z-QuotedNameArgumentTest.test_get_table_optionsc                 C   s    t tj}|d| sJ d S )Nr   )r   r   r4   get_view_definitionrl   r\   rs   r6   r6   r7   test_get_view_definition  s   
z/QuotedNameArgumentTest.test_get_view_definitionc                 C      t tj}||sJ d S r   )r   r   r4   get_columnsr   r6   r6   r7   test_get_columns     
z'QuotedNameArgumentTest.test_get_columnsc                 C   r   r   )r   r   r4   get_pk_constraintr   r6   r6   r7   test_get_pk_constraint  r   z-QuotedNameArgumentTest.test_get_pk_constraintc                 C   r   r   )r   r   r4   get_foreign_keysr   r6   r6   r7   test_get_foreign_keys  r   z,QuotedNameArgumentTest.test_get_foreign_keysc                 C   r   r   )r   r   r4   get_indexesr   r6   r6   r7   test_get_indexes  r   z'QuotedNameArgumentTest.test_get_indexesc                 C   r   r   )r   r   r4   get_unique_constraintsr   r6   r6   r7   test_get_unique_constraints     
z2QuotedNameArgumentTest.test_get_unique_constraintsc                 C   r   r   )r   r   r4   get_table_commentr   r6   r6   r7   test_get_table_comment  r   z-QuotedNameArgumentTest.test_get_table_commentc                 C   r   r   )r   r   r4   get_check_constraintsr   r6   r6   r7   test_get_check_constraints  r   z1QuotedNameArgumentTest.test_get_check_constraintsN)r9   r:   r;   Zrun_create_tablesr   r<   rP   r   r   r   rG   r   r   r   r   r   r   unique_constraint_reflectionr   comment_reflectionr   check_constraint_reflectionr   r6   r6   r6   r7   r   "  s8    
R





r   c              
   C   s   t jd dd t jjfdd}t jtjtjtjdd}t jtj	tj
tjtjtjtj	tj
B tj	tjB dd}t jddd	d}||||| S )
Nc                   S   s   t jS r   )r   rI   r6   r6   r6   r7   r     s    z$_multi_combination.<locals>.<lambda>rF   r   r-   r   TF
use_filter)r   r   rG   rH   r   DEFAULT	TEMPORARYANYr   TABLEVIEWMATERIALIZED_VIEWZANY_VIEW)r   rF   r-   r   filter_namesr6   r6   r7   _multi_combination  s2   


r   c                   @   s$  e Zd Zd ZZdZedd Zedd Zedd Z	ed	d
 Z
edd Zdd Zdd Zdd ZdejejdfddZdejejdfddZdejejdfddZedd ZdejejdfddZedd Zdejejdfdd Zed!d" Zdejejdfd#d$Zed%d& Zdejejdd'fd(d)Zed*d+ Zdejejdfd,d-Zed.d/ Z e!j"j#d0d1 Z$e!j"j#d2d3 Z%e!j"j#d4d5 Z&e!j"j#d6d7 Z'e!j"j#e!j"j(d8d9 Z)e!j"j#d:d; Z*e!j"j#d<d= Z+e!j,dd>e!j"j-fd?d@e!j,de!j"j.fd'dAd@dBdC Z/e!j,de!j"j.fd'dAd@dDdE Z0e!j"j1dFdG Z2e!j"j3e!j"j4dHdI Z5e!j"j6dJdK Z7e!j"j6e!j"j.dLdM Z8ddNdOZ9e!j,dPd'de!j"j.fdd'e!j"j3fdde!j"j.e!j"j3 fdQd@dRdS Z:e!j"j;dTdU Z<e!j"j;dVdW Z=e!j"j;e!j"j>e!j"j4dXdY Z?e!j,dZde!j"j.fdAd@e!j"j@d[d\ ZAe!j,dZde!j"j.fdAd@e!j"j-d]d^ ZBe!j"jCe!j"j.d_d` ZDe!j,dZde!j"j.fdAd@e!j"jEdadb ZFe!j,dcddded@e!j"jEe!j"jGe!j"jHdfdg ZIe!j"j;e!j"jJdhdi ZKe!j"jLdjdk ZMe!j,de!j"j.fdZdAd@e!j"jJdldm ZNe!j"j3e!j,dZde!j"j.fdAd@dndo ZOe!j"j3dpdq ZPe!j"jQdrds ZRe!j,de!j"j.fdZdAd@dtdu ZSe!,de!j"j.fd'dvdw ZTe!jUdxdy ZVe!j"jWeXdzd{ ZYe!j"j6eXd|d} ZZd~d Z[dddZ\dddZ]eXdd Z^e!j"j@eXdd Z_dd Z`e!j"j-eXdd Zae!j"jEeXdd Zbe!j"jJeXdd Zce!j"jdeXdd Zee!j,de!j"jWfdde!j"j@fde!j"j-fde!j"jEfde!j"jJfde!j"jdfde!j"j6fdd@	dd Zfdd Zge!j,dd'dAd@e!j,de!j"jhfd'dd@dd Zie!j"j6dd Zje!j"jkdd ZldS )ComponentReflectionTestNTc                 C   s.   |  |d  tjjjr|  |tjj d S d S r   )define_reflected_tablesr   rG   rH   r0   r   rI   rN   r6   r6   r7   rP     s   
z%ComponentReflectionTest.define_tablesc                 C   s  |r|d }nd}t jjjrtd| ddf}nd}td|tdtjd	d
tdt	dddtdt
 ddtdtjg|R  tjddddtd|d	d
}td|tdtjd	d
tdtjtd| dddtdtjtd| tdtdd	d tjd!d"dtjddd#d$d|d	d
 td%|tdtjtd&tjt|jjtd'td(d	d)tjdd*d+d|d	d td,|td-tjd	d.d/tdtd(d0d1td2td(d3d1td4td5d6d1|d7d8 td9|tdtd(|d:d8 t jjjrR|d u rtd;|td-tjd	d
tdtd(td<td=t jj d	tjjjd> n7td?|td-tjd	d
td@tdAtjjj tdtd(|d	d tdB|td-tjd	d
tdtd(|d	d t jjjrtdC|jj|jjd	d  tdD|jj|jj|jj |stdE|tdFtdd	dG}tdH|td-tjd	d
tdFtdd	dG}t jjjrt jjjrtdI|jj  tdJ|jj  t jj jr| !|| |st jj"jr| #| d S d S d S )KN. z%susers.user_id
user_id_fkr   r6   usersuser_idTr@   test1   Fnullabletest2parent_user_id	test2 > 0zz_test2_gt_zerousers check constraintr\   r   test2 <= 1000rF   r   
dingalingsdingaling_id
address_idz%semail_addresses.address_idzz_email_add_id_fgdi fk commentid_userrB      )uniquez$address_id > 0 AND address_id < 1000address_id_gt_zerozz_dingalings_multipledi unique commentemail_addressesremote_user_idemail_address   )indexemail_ad_pkea pk commentcomment_testr?   
id comment)rA   r   data % commentr   d2)Comment types type speedily ' " \ '' Fun!d3*   Comment
withescapesthe test % ' " \ table comment)rF   r   no_constraints"no
constraintshasescapedcommentlocal_table	remote_idz%s.remote_table_2.id)r   rF   remote_tablelocal_idz%s.local_table.idremote_table_2users_t_idxusers_all_idxnoncol_idx_test_nopkqr   noncol_idx_test_pknoncol_idx_nopknoncol_idx_pk)$r   rG   self_referential_foreign_keysr0   r   r   r   r_   r`   CHARFloatr   r   r   r   r   r   r   cross_schema_fk_reflectionr   rI   r4   ri   default_schema_nameindex_reflectionr!   r   r   indexes_with_ascdescreflect_indexes_with_ascdescr  descr   rK   temp_table_reflectionrM   )r5   rO   rF   Zschema_prefixZparent_id_argsr   r  r  r6   r6   r7   r     s@  

	
 


		z/ComponentReflectionTest.define_reflected_tablesc                 C   rU   rV   rW   rY   r6   r6   r7   rZ     r[   z'ComponentReflectionTest.temp_table_namec                 C   s   t ttj}|  }t||tdtjddtdtdtdtjtj	ddtj
 dtd	dfi |}tjjjrVtjjjrXt|d
tdtj
  t|dtd d S d S d S )Nr?   Tr@   r\   rC   r   user_tmp_uq_r   user_tmp_ixrQ   r]   rR   r^   )r   r   r4   rZ   r   r   r_   r`   ra   r   rX   r!   r   rG   rJ   r0   rb   r   rS   r    rc   r6   r6   r7   rM     s8   

z*ComponentReflectionTest.define_temp_tablesc              
   C   s   t jjjr	dh}nt }dD ]b}|}|r| d| }|d }||v r%dnd}d| d| d	| }t|d
t| ||v rad}	|rOt drO| d|	 }	d|	 d| d}
t|d
t|
 t|dtd| d|  qd S )Nr   r   r   r   r   _vzMATERIALIZED r   zCREATE zVIEW z AS SELECT * FROM rQ   	mat_indexoraclezCREATE INDEX z ON z(data)rR   zDROP )	r   rG   materialized_viewsr0   setr   rS   r    against)r5   rO   rF   materializedre   fullnameZ	view_nameprefixrT   Z
index_namer   r6   r6   r7   rK     s,   
z$ComponentReflectionTest.define_viewsc                 C   sD   i }t j|v r|| t j|v r|| t j|v r || |S r   )r   r   updater   r   )rl   r   r   r   r+  r   r6   r6   r7   _resolve_kind  s   





z%ComponentReflectionTest._resolve_kindc                 C   sB   t jjjs|  |  d S t jjjs|| |  d S d S r   )r   rG   r   r0   clearr(  r.  )rl   r   r+  r6   r6   r7   _resolve_views  s   


z&ComponentReflectionTest._resolve_viewsc              	      s   dd |t ju rdd |t ju rdd d ddhtjjddd	d
|  hitjjj	s>d  
d tjj ddg tjjj	sLd  dd	g tjjj	rVtjjj	sad  d
|  g tjjj	snd  d
g  fdd| D }|S )Nc                 S   s   dS )NTr6   )_r6   r6   r7   r     s    z8ComponentReflectionTest._resolve_names.<locals>.<lambda>c                 S   s   d| d vS Ntmp   r6   r   r6   r6   r7   r         c                 S   s   d| d v S r3  r6   r6  r6   r6   r7   r     r7  r  r  r  r  r  r   c                    s>   i | ]\}}|r|d   vr r|d   v r||qS )r5  r6   ).0r   vr   removedrF   Zscope_filterr6   r7   
<dictcomp>  s    z:ComponentReflectionTest._resolve_names.<locals>.<dictcomp>)r   r   r   r   r   rI   rZ   rG   r  r0   addr.  r  r!  temp_table_namesrb   items)rl   rF   r-   r   valuesr   r6   r:  r7   _resolve_names  sD   





z&ComponentReflectionTest._resolve_namesc           	      C   s   |dft ji}|dft j|dft j|dft ji}| || |dft j|dft j|dft j|dft j|d	ft j|d
ft j|dft j|dft j|dft j|dft j||  ft ji}| ||||}| ||||}|S )Ndingalings_vemail_addresses_vusers_vr   r   r   r   r   r
  r  r  r  r  r  r(   r   r1  rZ   r/  rA  )	rl   rF   r-   r   r   r+  r   r   r   r6   r6   r7   exp_options  s*   












z#ComponentReflectionTest.exp_optionsc           
      C   s   dd i}|df|i}|df||df||df|i}|  || |df||df||df||d	fdd
i|dfddi|df||df||df||df||df|||  f|i}| ||||}	| ||||	}	|	S )NtextrB  rC  rD  r   r   r   r   r   r	  r
  r  r  r  r  r  r  )r1  rZ   r/  rA  )
rl   rF   r-   r   r   emptyr+  r   r   r   r6   r6   r7   exp_comments-  s4   z$ComponentReflectionTest.exp_commentsc           
         s$  dt jd dfdd  fdd}|df dd	t jd
 d d dgi}|df dd	t jd
 d dg|df dd	t jd
 dt jd dt jd dg|df dd	t jd
 d dgi}| || |df|d ddd ddd dg|df|d d d dg|df|d d dg|df|ddd  dd!d  d"d#d  d$d%d g|d&f dg|d'f|d d d(g|d)f|d d* dg|d+f|d dg|d,f d-g|d.f|d d-g||  f|d d dgi}| ||||}	| ||||	}	|	S )/NFTc                 S   s*   | |t j|||d}|dkr|d |S )N)r\   autoincrementtypedefaultr   r   omitrJ  )r(   r   pop)r\   autorL  r   r   r   r6   r6   r7   ro   X  s   
z0ComponentReflectionTest.exp_columns.<locals>.colc                    s"   dt jdd|} | fi |S )NTF)rO  rL  r   r(   r   )r\   rd   ro   r6   r7   pkg  s   z/ComponentReflectionTest.exp_columns.<locals>.pkrB  r   rM  )rO  r   r   r   rB   rC  r   r   rD  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  r  rE  )
rl   rF   r-   r   r   rR  r+  r   r   r   r6   rQ  r7   exp_columnsQ  s   

	




	
'z#ComponentReflectionTest.exp_columnsc                 C      h dS )N>   r   r\   rL  rK  r6   rl   r6   r6   r7   _required_column_keys     z-ComponentReflectionTest._required_column_keysc                 C   sH  t jd ddd}|d d}tjjjr|df|di}n|df|i}|df||df||d	f|i}| || |d
f|d|df|d|df|dddd|df|d|df||df|d|df|d|df|d|df||df|d||  f|di}	tjjjs|		 D ]}
|
d d urt j|
d< q| 
||	||}| ||||}|S )Nr   c                 W   s   t || |dS )N)constrained_columnsr\   r   )list)r\   r   colsr6   r6   r7   rR    s   z+ComponentReflectionTest.exp_pks.<locals>.pkr   rB  r   rC  rD  r   r   r   r   r   r   r   r   r   r?   r
  r  r  r  r  r  r\   )r(   r   r   rG   Zmaterialized_views_reflect_pkr0   r1  rZ   reflects_pk_namesr@  r/  rA  )rl   rF   r-   r   r   rR  rH  r+  r   r   valr   r6   r6   r7   exp_pks  s@   



zComponentReflectionTest.exp_pksc                 C      ddhS )Nr\   rX  r6   rU  r6   r6   r7   _required_pk_keys  rW  z)ComponentReflectionTest._required_pk_keysc                    s  G dd d |t jd f fdd	}|dfg i}|dfg |dfg |dfg i}| || |d	f|d
gdgd	ddg|df|dgdgd	|dgdgddddg|df|dgdgd	g|dfg |dfg |df|dgdgdtjdg|df|dgdgdd dg|dfg |dfg |d fg ||  fg i}tjjj	s||d	f 
  tjjj	s| D ]}	|	D ]}
|
d! t jurt j|
d!< qq| ||||}| ||||}|S )"Nc                   @      e Zd Zdd ZdS )z+ComponentReflectionTest.exp_fks.<locals>.ttc                 S   s   |d u p
t jjj|kS r   )r   r4   ri   r  rl   otherr6   r6   r7   __eq__  s   z2ComponentReflectionTest.exp_fks.<locals>.tt.__eq__Nr9   r:   r;   rc  r6   r6   r6   r7   r         r   c                    s$   | ||t j|d ur|n  ||dS )N)rX  referred_columnsr\   r.   referred_schemareferred_tabler   rP  )rZ  ref_colZ	ref_table
ref_schemar\   r   r   r6   r7   fk  s   	z+ComponentReflectionTest.exp_fks.<locals>.fkrB  rC  rD  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r
  r  r  r?   r  )rj  r  r  r  r  r\   )r(   r   r1  r   rI   rZ   r   rG   r  r0   r0  named_constraintsr@  r/  rA  )rl   rF   r-   r   r   rl  r+  r   r   valsr\  r   r6   rk  r7   exp_fks  sr   

#

zComponentReflectionTest.exp_fksc                 C   rT  )N>   rh  rf  r\   rX  rg  r6   rU  r6   r6   r7   _required_fk_keysA  rW  z)ComponentReflectionTest._required_fk_keysc           
      C   s  dd ddddd}|dfg i}|dfg |dfg |dfg i}|  || |r3||df |d	d
d |dfg |dddd|ddddd|ddddd|dfg |d	tjddd|dtjdd|dddddd|dfg |dtjd|dtjdd|d fg |d!fg |d"fg |d#tjdd|d$fg |d%tjdd|d&fg |d'fg |d(d)d(d*id+|d,fg |d(d-d(d*id+||  fg |d.d/d|d0d1tj ddd2i}tjj	j
rtjjj
s||d'f   ||d,f   | ||||}	| ||||	}	|	S )3NF)r   column_sorting
duplicatesrl  c                    s   t jj}t jj}t jj}|r|jr|r|jsdS |t|| tjg d}	 r? |	d< |jr?|	d  |	d< }
 fdd|
D |	d< |rE| |	d< |	gS )	Nr6   )r   column_namesr\   dialect_optionsinclude_columnsrq  rs  expressionsc                    s   g | ]
}| v r
d n|qS r   r6   r8  r   rq  r6   r7   
<listcomp>o  s    zDComponentReflectionTest.exp_indexes.<locals>.idx.<locals>.<listcomp>Zduplicates_constraint)	r   rG   Zforeign_keys_reflect_as_indexZ#unique_constraints_reflect_as_indexZ*reflect_indexes_with_ascdesc_as_expressionr0   rY  r(   r   )r\   r   rq  rr  rl  rZ  Zfk_reqZdup_reqZsorting_expressionr   origr6   rx  r7   r   R  s4   


z0ComponentReflectionTest.exp_indexes.<locals>.idxrB  rC  rD  r   rB   r&  r   r   r   r   T)r\   rl  r   r   r   r  r  )r\   r   r   )r\   r   rr  r   r   r   r   r   r   r   r   r
  r  r  r  r  r  r  r  r  )r   )r\   rq  r  r  r   r#  r\   r"  )r\   rr  r   )r1  extendr(   r   rZ   r   rX   r   rG   r  r0   r  r0  r/  rA  )
rl   rF   r-   r   r   r   r+  r   r   r   r6   r6   r7   exp_indexesK  s   
%



5z#ComponentReflectionTest.exp_indexesc                 C   rT  )N>   r\   r   rs  r6   rU  r6   r6   r7   _required_index_keys  rW  z,ComponentReflectionTest._required_index_keysFc                 C   s(  d dd ddd}|dfg i}|dfg |dfg |dfg i}|  || |d	fg |d
ddddd|dfg |dtjtjd|dddddd|dfg |dfg |dfg |dfg |dfg |dfg |dfg |dfg ||  fg |dd tj d!i}	|ri |||	S | ||	||}
| ||||
}
|
S )"NF)duplicates_indexis_indexr   c                 W   s8   t jj}|r|jsdS t|| |d}|r||d< |gS )Nr6   )rs  r\   r   r~  )r   rG   Z*unique_index_reflect_as_unique_constraintsr0   rY  )r\   r~  r  r   rZ  reqr   r6   r6   r7   uc  s   
z+ComponentReflectionTest.exp_ucs.<locals>.ucrB  rC  rD  r   r   r   r   r  T)r\   r~  r  r   rB   )r\   r~  r   r   r   r   )r\   r~  r   r   r   r
  r  r  r  r  r  r\   r"  r   )r1  r(   r   rZ   r   rX   r/  rA  )rl   rF   r-   r   r   all_r  r+  r   r   r   r6   r6   r7   exp_ucs  sZ   		
 zComponentReflectionTest.exp_ucsc                 C   r^  )Nr\   rs  r6   rU  r6   r6   r7   _required_unique_cst_keys	  rW  z1ComponentReflectionTest._required_unique_cst_keysc           
         s   G dd dt  d fdd	}|dfg i}|dfg |dfg |dfg i}| || |d	f|d
tj|ddddg|df|dddg|dfg |dfg |dfg |dfg |dfg |dfg |dfg |dfg ||  fg i}| ||||}	| ||||	}	|	S )Nc                   @   r`  )z+ComponentReflectionTest.exp_ccs.<locals>.ttc                 S   s(   |  dddddd}| |v S )N(r   )`)lowerreplace)rl   rb  r   r6   r6   r7   rc    s   z2ComponentReflectionTest.exp_ccs.<locals>.tt.__eq__Nrd  r6   r6   r6   r7   r     re  r   c                    s    | ||dS )N)sqltextr\   r   r6   )rG  r\   r   rk  r6   r7   cc  s   z+ComponentReflectionTest.exp_ccs.<locals>.ccrB  rC  rD  r   r   r   r   r   r   r  r   z$address_id > 0 and address_id < 1000r   r   r   r   r
  r  r  r  r  r  r   )strr1  r(   r   rZ   r/  rA  )
rl   rF   r-   r   r   r  r+  r   r   r   r6   rk  r7   exp_ccs  sF   

zComponentReflectionTest.exp_ccsc                 C   r^  )Nr\   r  r6   rU  r6   r6   r7   _required_cc_keysG  rW  z)ComponentReflectionTest._required_cc_keysc                 C   s    t |}ttjj| v  d S r   )r   r'   r   r   rI   get_schema_namesr|   r6   r6   r7   test_get_schema_namesK  s   z-ComponentReflectionTest.test_get_schema_namesc                 C   s,   t |}t|tjj t|d d S )Nsa_fake_schema_foo)r   r'   
has_schemar   r   rI   r&   r|   r6   r6   r7   test_has_schemaQ  s   z'ComponentReflectionTest.test_has_schemac                 C   s8   |j ddttjjid}t|}ttjj| v  dS )z
test #7300r   barZschema_translate_mapN)execution_optionsr#   r   r   rI   r   r'   r  r|   r6   r6   r7   %test_get_schema_names_w_translate_mapX  s   z=ComponentReflectionTest.test_get_schema_names_w_translate_mapc                 C   sD   |j ddttjjid}t|}t|tjj t|d d S )Nr   r  r  r  )	r  r#   r   r   rI   r   r'   r  r&   r|   r6   r6   r7   test_has_schema_w_translate_mapf  s   z7ComponentReflectionTest.test_has_schema_w_translate_mapc              
   C   s   t |}td| v  t|d |td z,td| v  t|d |  td| v  t|d W |td d S |td w )NZfoo_barzCREATE SCHEMA foo_barzDROP SCHEMA foo_bar)r   r&   r  r  executer    rq   r'   r|   r6   r6   r7   test_schema_caches  s   "z)ComponentReflectionTest.test_schema_cachec                 C   s$   t  }t| t|jdsJ d S )Nr  )r   r2   r   hasattrri   )rl   enginer6   r6   r7   test_dialect_initialize  s   z/ComponentReflectionTest.test_dialect_initializec                 C   s   t |}t|j|jj d S r   )r   r   r  ri   r|   r6   r6   r7   test_get_default_schema_name  s   z4ComponentReflectionTest.test_get_default_schema_nameforeign_keyorder_byr   
use_schemac           	         s   |rt j}nd }h d t|}|rdd ||D }n||} fdd|D }|dkr:g d}t|| d S g d}tt|| d S )N>   r
  r  r   r  r  r  r  c                 S   s   g | ]
}|d  r|d  qS )r   r6   )r8  Zrecr6   r6   r7   ry    s    z@ComponentReflectionTest.test_get_table_names.<locals>.<listcomp>c                    s   g | ]}| vr|qS r6   r6   r8  tZ_ignore_tablesr6   r7   ry    s    r  r$  )r   r   r   )r   rI   r   Zget_sorted_table_and_fkc_namesget_table_namesr   sorted)	rl   r}   r  r  rF   rs   r   table_namesanswerr6   r  r7   test_get_table_names  s    	

z,ComponentReflectionTest.test_get_table_namesc                 C   sn   t |}|r
tj}nd }||}tjjjr*tt	|ddg t|
|dg d S g d}tt	|| d S )NrC  rD  rB  )rB  rC  rD  )r   r   rI   get_view_namesr   rG   r(  r0   r   r  get_materialized_view_names)rl   r}   r  rs   rF   r  r  r6   r6   r7   test_get_view_names  s   

z+ComponentReflectionTest.test_get_view_namesc                 C   s,   t |}| }tt|dtj g d S rV   )r   Zget_temp_table_namesr   r  r   rX   rl   r}   rs   r>  r6   r6   r7   test_get_temp_table_names  s   z1ComponentReflectionTest.test_get_temp_table_namesc                 C   s$   t |}| }tt|dg d S r   )r   Zget_temp_view_namesr   r  r  r6   r6   r7   test_get_temp_view_names  s   z0ComponentReflectionTest.test_get_temp_view_namesc                 C   s   |  | d S r   )_test_get_commentsrl   r}   r6   r6   r7   test_get_comments  s   z)ComponentReflectionTest.test_get_commentsc                 C   s   |  |tjj d S r   )r  r   r   rI   r  r6   r6   r7   test_get_comments_with_schema  s   z5ComponentReflectionTest.test_get_comments_with_schemac                 C   s   t |}| j|d}t|jd|d||df  t|jd|d||df  t|jd|d||df  | jjj}t|j||d|||f  d S )NrE   r   r   )r   rI  r   r   r   r
  r\   )rl   r}   rF   rs   expno_cstr6   r6   r7   r    s&   




z*ComponentReflectionTest._test_get_comments)FFzuse_views,use_schemac                 C   sh  |rt j}nd }| jj| jj}}|rg d}nddg}t|}t|||fD ]\}	}
|}|j|	|d}tt	|dkt	| t
|
jD ]l\}}t|j|| d  || d j}|j}t|tjjrf|j}tdrv|tjtjfv rvtj}tt	t|j|jtjtjtjtjtjtjtj gdkd	|j|j|| d |f  |j!s|| d
 d u sJ qDq'd S )NrD  rC  rB  r   r   rE   r   r\   rK  r'  z%s(%s), %s(%s)rL  )"r   rI   r   r   r   r   zipr   r'   len	enumeratecolumnsr   r\   	__class__rK  r   r_   r   Z
TypeEnginer   r*  	sql_typesDateDateTimer)  __mro__intersectionr   NumericZTimer   Z_BinaryrA   )rl   r}   Z	use_viewsr  rF   r   	addressesr  rs   re   tableZschema_namerZ  iro   ctypeZ	ctype_defr6   r6   r7   r     sb   
z(ComponentReflectionTest.test_get_columnsc                 C   s6   |   }| j| }t|t |d}| j||dd d S )Nautoload_withF)Zstrict_constraints)rZ   r   r   r   Zassert_tables_equal)rl   r}   re   rf   Zreflected_user_tmpr6   r6   r7   test_reflect_table_temp_tableE  s   

z5ComponentReflectionTest.test_reflect_table_temp_tablec                 C   sf   |   }| j| }t|}||}tt|dkt| t|jD ]\}}t|j	|| d  q"d S )Nr   r\   )
rZ   r   r   r   r'   r  r  r  r   r\   )rl   r}   re   rf   rs   rZ  r  ro   r6   r6   r7   test_get_temp_table_columnsQ  s   

z3ComponentReflectionTest.test_get_temp_table_columnsc                 C   s.   t |}|d}tdd |D g d d S )Nr   c                 S      g | ]}|d  qS r   r6   r8  ro   r6   r6   r7   ry  b      zFComponentReflectionTest.test_get_temp_view_columns.<locals>.<listcomp>)r?   r\   r   )r   r   r   )rl   r}   rs   rZ  r6   r6   r7   test_get_temp_view_columns\  s   
z2ComponentReflectionTest.test_get_temp_view_columnsFc                 C   s  |rt jj}nd }| jj| jj}}t|}| j|d}|j|j	|d}| 
|g|||j	f g| j |j|j	|d}	|||j	f d }
t|	d |
 t jj  t|	d d W d    n1 scw   Y  | jjj	}| 
|j||dg|||f g| j d S )NrE   rX  r\   r   )r   r   rI   r   r   r   r   r]  r   r\   _check_listr_  r   rG   r[  fail_ifr
  )rl   r}   r  rF   r   r  rs   r  Z
users_consZ	addr_consZexp_colsr  r6   r6   r7   r   d  s,   

z.ComponentReflectionTest.test_get_pk_constraintc                 C   s|  |rt j}nd }| jj| jj}}t|}|}tjjj	rd|j
|j|d}|d }	tjj  t|	d d W d    n1 s@w   Y  t|	d | t|	d |j t|	d dg t|	d	 d
g |j
|j|d}
|
d }	tjj  t|	d d u W d    n1 sw   Y  t|	d | t|	d |j t|	d dg t|	d	 dg | jjj}t|j
||dg  d S )NrE   r   r\   r   rg  rh  rf  r   rX  r   r   )r   rI   r   r   r   r   r   rG   r  r0   r   r\   rm  r  r   implicitly_named_constraintsr'   r
  )rl   r}   r  rF   r   r  rs   Zexpected_schemaZusers_fkeysfkey1Z
addr_fkeysr  r6   r6   r7   r     s6   

z-ComponentReflectionTest.test_get_foreign_keysc           
      C   s  |  d|jj dtjj dtjj \}}}t|}||j}t	t
|d |d }t	|d tjj t	|d |j t	|d d	g t	|d
 dg |j|jtjjd}t	t
|d |d }	t|	d d |jjfv  t	|	d |j t	|	d d	g t	|	d
 dg d S )Nz%s.local_tablez%s.remote_tablez%s.remote_table_2r5  r   rg  rh  rf  r?   rX  r  rE   r  )r   ri   r  r   r   rI   r   r   r\   r   r  r'   )
rl   r}   r  r  r  rs   Zlocal_fkeysr  Zremote_fkeysZfkey2r6   r6   r7   "test_get_inter_schema_foreign_keys  s8   




z:ComponentReflectionTest.test_get_inter_schema_foreign_keysc                 C   sz   |rt j}nd }t|}|jd|d}| j|d}| |||df | j | jjj	}| |j||d|||f | j d S )Nr   rE   )
r   rI   r   r   r|  r  r}  r   r
  r\   )rl   r}   r  rF   rs   indexesr  r  r6   r6   r7   r     s   

z(ComponentReflectionTest.test_get_indexes)r  r  )r  r  ztname,ixnamec                 C   s   t |}||}|  d |f }| ||| j t|t |d}tt|j	d t
t|j	d j| tt|j	d j| d S )Nr  r5  r   )r   r   r|  r  r}  r   r   r   r  r  r
   rY  r  r\   )rl   r}   tnameZixnamers   r  Zexpected_indexesr  r6   r6   r7   test_get_noncol_index  s   	
z-ComponentReflectionTest.test_get_noncol_indexc                 C   sB   t |}|  }||}| jddd |f }| ||| j d S )NT)r  )r   rZ   r   r  r  r}  )rl   r}   rs   r\   	reflectedr  r6   r6   r7   &test_get_temp_table_unique_constraints  s
   
z>ComponentReflectionTest.test_get_temp_table_unique_constraintsc                 C   sn   t |}|  }||}|D ]}|dd  qddgddg}tjjjr+g |d d< tdd	 |D | d S )
Nrt  Fr   r#  )r   rs  r\   r   ru  c                 S   s   g | ]
}|d  dkr|qS )r\   r#  r6   r8  r   r6   r6   r7   ry    r   zGComponentReflectionTest.test_get_temp_table_indexes.<locals>.<listcomp>)	r   rZ   r   rN  r   rG   index_reflects_included_columnsr0   r   )rl   r}   rs   re   r  indexpectedr6   r6   r7   test_get_temp_table_indexes  s   

z3ComponentReflectionTest.test_get_temp_table_indexesc                 C   s  |rt j}nd }tddgddg dddg dddd	d
gdddgdddgdgtdd}td|tdtdtdtdtdtj	td	tdtd
td|d}|D ]}|
tj|d d|d i q\|| t|}t|jd|dtdd}	t }
tt|t|	 t||	D ]\}}|dd }|r|
| t|dd d  t|| qt }td|||d}	dd |	jD }dd |	jD dg}||rJ |
rt|
| t|t  | jjj}t|j||dg  d S )NZunique_ar   )r\   rs  Zunique_a_b_c)r   br   Zunique_c_a_b)r   r   r  Zunique_asc_keyasckeyzi.have.dotsr  zi have spacesr   r\   r  Ztesttblr   r   rE   rs  r~  r   )r  rF   c                 S   s   h | ]}|j qS r6   r   r  r6   r6   r7   	<setcomp>j  s    zFComponentReflectionTest.test_get_unique_constraints.<locals>.<setcomp>c                 S   s   h | ]}t |tjr|jqS r6   )r   r_   r   r\   )r8  Zuqr6   r6   r7   r  k  s    
)r   rI   r  operator
itemgetterr   r   r_   r   r   Zappend_constraintr   rp   r   r   r)  r   r  r  rN  r=  r   r  constraints
differencer  r   r
  r\   )rl   rO   r}   r  rF   Zuniquesr  r  rs   r  Znames_that_duplicate_indexrz  ZreflZdupeZreflected_metadataZ	idx_namesZuq_namesr  r6   r6   r7   r     sx   







z3ComponentReflectionTest.test_get_unique_constraintsc                 C   s@   |rt j}nd }t|}dD ]}|j||d}tt| qd S )Nr  rE   )r   rI   r   r   r'   bool)rl   r}   r  rF   rs   viewr9  r6   r6   r7   r   y  s   z0ComponentReflectionTest.test_get_view_definitionc                 C   sr   t |}tt |d W d    n1 sw   Y  tt |d W d    d S 1 s2w   Y  d S )NZview_does_not_existr   )r   r   r   r   r|   r6   r6   r7   'test_get_view_definition_does_not_exist  s   

"z?ComponentReflectionTest.test_get_view_definition_does_not_existc                 C   sF   t |}dD ]\}}||}dd |D | }|dds J qdS )a  test that 'autoincrement' is reflected according to sqla's policy.

        Don't mark this test as unsupported for any backend !

        (technically it fails with MySQL InnoDB since "id" comes before "id2")

        A backend is better off not returning "autoincrement" at all,
        instead of potentially returning "False" for an auto-incrementing
        primary key column.

        ))r   r   )r   r   )r   r   c                 S      i | ]}|d  |qS r   r6   rw  r6   r6   r7   r<        zBComponentReflectionTest.test_autoincrement_col.<locals>.<dictcomp>rJ  TN)r   r   get)rl   r}   rs   r  cnamerZ  Zid_r6   r6   r7   test_autoincrement_col  s   
z.ComponentReflectionTest.test_autoincrement_colc                 C   s   t tj}|r
tjnd }tjjjr/|jd|d}t	t
|t |jd|d}t	t
|t d S tt |jd|d}W d    d S 1 sFw   Y  d S )Nr   rE   r
  )r   r   r4   rI   r   rG   r   r0   r   r'   r   r3   r   r   )rl   r  rs   rF   r   r6   r6   r7   r     s   


"z.ComponentReflectionTest.test_get_table_optionsc                    s   t tj tjjjr,|rtjnd  jd} fdd j	dD }t
|| d S tt   }W d    d S 1 s@w   Y  d S )NrE   c                    s    i | ]}|f j |d qS )rE   )r   )r8  r  rs   rF   r6   r7   r<    s    zHComponentReflectionTest.test_multi_get_table_options.<locals>.<dictcomp>)r   r   r4   r   rG   r   r0   rI   get_multi_table_optionsr  r   r   r   )rl   r  r   r  r6   r  r7   test_multi_get_table_options  s   




"z4ComponentReflectionTest.test_multi_get_table_optionsc                    s    fdd}|S )Nc                    s   t  }||d ||d}| r|  } g }tj|v r!|g d tj|v r-|ddg tj|v r9|ddg | r?| |d< |rE||d< || |||dd	}	|g}
|tjkrf|	 }|
d
 |
| |tjkry|	 }|
d |
| t  |
|	fS )Nr   )r-   r   )r   r   does-not-existrC  r  rB  rF   r   )rF   r-   r   r   r-   r   )r   r   r   r{  r   r   r  r   r   copyrN  append)rF   r-   r   r   Zsingle_reflect_fnZ
exp_methodrs   rd   r   r  kwsZnkwr}   r6   r7   provide_fixture  sD   










z>ComponentReflectionTest.get_multi_exp.<locals>.provide_fixturer6   )rl   r}   r  r6   r  r7   get_multi_exp  s   .z%ComponentReflectionTest.get_multi_expc                 C   sL   |||||t j| j\}}}|D ]}	|  |jdi |	}
t|
| qd S Nr6   )r   r   rF  rq   r  r   rl   r  rF   r-   r   r   rs   r  r  rd   resultr6   r6   r7   #test_multi_get_table_options_tables  s   
z;ComponentReflectionTest.test_multi_get_table_options_tablesc           
      C   sH   |||||t j| j\}}}|D ]}	|  t|jdi |	| qd S r  )r   r   rI  rq   r   Zget_multi_table_comment)
rl   r  rF   r-   r   r   rs   r  r  rd   r6   r6   r7   test_get_multi_table_comment  s   
z4ComponentReflectionTest.test_get_multi_table_commentc                    sX   dt fdd t|trt fdd| D || d S t fdd|D || d S )NrG  c                 S   s   t dd|  S )Nz['\" ]r   )resubr  )rG  r6   r6   r7   _clean  s   z:ComponentReflectionTest._check_expressions.<locals>._cleanc                    s   i | ]	\}} ||qS r6   r6   )r8  er9  r   r6   r7   r<  #      z>ComponentReflectionTest._check_expressions.<locals>.<dictcomp>c                    s   g | ]} |qS r6   r6   )r8  r  r  r6   r7   ry  %  r  z>ComponentReflectionTest._check_expressions.<locals>.<listcomp>)r  r   r3   r   r?  )rl   r  r  err_msgr6   r  r7   _check_expressions  s   
"z*ComponentReflectionTest._check_expressionsc           	      C   s   |d u rt ||| d S t t|t|| t||D ]?\}}t|t|B D ]2}||v s5||v rY||v rY| d| d| }|dv rO| || || | q't || || | q'qd S )Nz - )rv  rq  )r   r  r  r)  r  )	rl   r  r  req_keysmsgrr  r   r  r6   r6   r7   r  '  s   z#ComponentReflectionTest._check_listc                 C   s\   t t| t|  |D ]}|| || }}|r#|g|g}}| |||| qd S r   )r   r)  keysr  )rl   r  r  r  
make_listsr   r  r  r6   r6   r7   _check_table_dict5  s   z)ComponentReflectionTest._check_table_dictc                 C   R   |||||t j| j\}}}|D ]}	|  |jdi |	}
| |
|| j qd S r  )r   r   rS  rq   get_multi_columnsr  rV  r  r6   r6   r7   test_get_multi_columns=  s   
	z.ComponentReflectionTest.test_get_multi_columnsc                 C   sV   |||||t j| j\}}}|D ]}	|  |jdi |	}
| j|
|| jdd qd S )NT)r
  r6   )r   r   r]  rq   Zget_multi_pk_constraintr  r_  r  r6   r6   r7   test_get_multi_pk_constraintO  s   

z4ComponentReflectionTest.test_get_multi_pk_constraintc                 C   sX   t jjjs(||fD ] }| D ]}t|dkr&tdd |D r&|j|d qq	d S d S )Nr5  c                 s   s$    | ]}| d dtjfv V  qdS )r\   N)r  r(   r   )r8  r9  r6   r6   r7   	<genexpr>g  s    
z7ComponentReflectionTest._adjust_sort.<locals>.<genexpr>r  )r   rG   r  r0   r@  r  anysort)rl   r  r  r  objr\  r6   r6   r7   _adjust_sortc  s   
z$ComponentReflectionTest._adjust_sortc                 C   d   |||||t j| j\}}}|D ]}	|  |jdi |	}
| |
|dd  | |
|| j qd S )Nc                 S      t | d S )NrX  tupledr6   r6   r7   r   }  r7  zEComponentReflectionTest.test_get_multi_foreign_keys.<locals>.<lambda>r6   )r   r   ro  rq   Zget_multi_foreign_keysr  r  rp  r  r6   r6   r7   test_get_multi_foreign_keysl  s    

z3ComponentReflectionTest.test_get_multi_foreign_keysc                 C   r  r  )r   r   r|  rq   Zget_multi_indexesr  r}  r  r6   r6   r7   test_get_multi_indexes  s   
z.ComponentReflectionTest.test_get_multi_indexesc                 C   r  )Nc                 S   r  )Nrs  r  r  r6   r6   r7   r     r7  zKComponentReflectionTest.test_get_multi_unique_constraints.<locals>.<lambda>r6   )r   r   r  rq   Zget_multi_unique_constraintsr  r  r  r  r6   r6   r7   !test_get_multi_unique_constraints     
z9ComponentReflectionTest.test_get_multi_unique_constraintsc                 C   r  )Nc                 S   r  )Nr  r  r  r6   r6   r7   r     r7  zJComponentReflectionTest.test_get_multi_check_constraints.<locals>.<lambda>r6   )r   r   r  rq   Zget_multi_check_constraintsr  r  r  r  r6   r6   r7    test_get_multi_check_constraints  r  z8ComponentReflectionTest.test_get_multi_check_constraintsr   r   r   r   r   r   r   r   methodc                 C   sH   t |}t||}tt |d W d    d S 1 sw   Y  d S )NZtable_does_not_exists)r   getattrr   r   )rl   r   r}   rs   r   r6   r6   r7   test_not_existing_table  s
   


"z/ComponentReflectionTest.test_not_existing_tablec              	      s   t j  fdd}tjt d|2 ttd t|t	dt
 d  W d    n1 s.w   Y  W d    d S W d    d S 1 sFw   Y  d S )Nc                     s&   | di }td|d<  | i |S )NZunreflectableerr)N
some_table)
setdefaultr   )r   r   urZmcr6   r7   patched  s   z;ComponentReflectionTest.test_unreflectable.<locals>.patchedr  r#  r$  )r   r  r(   patchobjectr   r   r   Zreflect_tabler   r   )rl   r}   r(  r6   r'  r7   test_unreflectable  s   "z*ComponentReflectionTest.test_unreflectabler   c                    s   t  }|rtjnd  |j| |dd t|}| }|r8|| 7 }z	|| 7 }W n	 ty7   Y nw  rC fdd|D }t	t
|jt
| d S )NF)rF   r   Zresolve_fksc                    s   g | ]	}  d | qS )r   r6   r  rE   r6   r7   ry    r  z9ComponentReflectionTest.test_metadata.<locals>.<listcomp>)r   r   rI   reflectr   r  r  r  r   r   r  r   )rl   r}   r  r   mrs   r   r6   rE   r7   test_metadata  s   
z%ComponentReflectionTest.test_metadatac              	   C   s   t d|tdtddtdtdddd || t|}|d}t|ddi |d}d	d
 |D }ddd}t|| d S )Nunicode_commentsunicodeu   é試蛇ẟΩr  emojiu	   ☁️✨u   試蛇ẟΩ✨rG  c                 S      i | ]	}|d  |d qS r   r6   rw  r6   r6   r7   r<  
	  r  zAComponentReflectionTest.test_comments_unicode.<locals>.<dictcomp>)r0  r1  r   r   r   
create_allr   r   r   r   )rl   r}   rO   rs   tcrZ  valuer  r6   r6   r7   test_comments_unicode  s   



z-ComponentReflectionTest.test_comments_unicodec                 C   sp   t d|tdtdddd || t|}|d}t|ddi |dd }t|d |d	 iddi d S )
Nr/  r1  u&   🐍🧙🝝🧙‍♂️🧙‍♀️r  u&   🎩🁰🝑🤷‍♀️🤷‍♂️rG  r   r\   r   r3  )rl   r}   rO   rs   r5  r   r6   r6   r7   test_comments_unicode_full	  s   

z2ComponentReflectionTest.test_comments_unicode_fullr   r)   )NF)mr9   r:   r;   run_insertsrun_deletesr   r<   rP   r   rZ   rM   rK   r/  r1  rA  r   r   r   rF  rI  rS  propertyrV  r]  r_  ro  rp  r|  r}  r  r  r  r  r   rG   Zschema_reflectionr  r  r  r  Zschema_create_deleter  r  r  r   !foreign_key_constraint_reflectionrH   r  r  r>  r  rJ   rb   r  r   r  r  r  r   r!  r  r  r   r  !primary_key_constraint_reflectionr   r   r  r  r  r   r  r  r  r   r  Ztemp_table_reflect_indexesr  r   r   r  table_reflectionr  r   r  fixturer  r   r   r  r  r  r  r  r  r  r  r  r  r  r   r  r"  r+  r   r.  r7  Zcomment_reflection_full_unicoder8  r6   r6   r6   r7   r     s   

 .

!

-
!
&
`

0

X

u

E

:







#




A


&$
V





1
	

	




r   c                   @   sh   e Zd ZdZdZejdd Zejdd Zdd Z	d	d
 Z
dd Zejjdd Zejjdd ZdS )TableNoColumnsTest)Zreflect_tables_no_columnsTc                 C   s   t d| || d S NrH  )r   r4  rl   r}   rO   r6   r6   r7   table_no_columns$	  s   
z#TableNoColumnsTest.table_no_columnsc                 C   s<   t d| t|dtd t|dtd || d S )NrH  rQ   z*CREATE VIEW empty_v AS SELECT * FROM emptyrR   zDROP VIEW IF EXISTS empty_v)r   r   rS   r    r4  rB  r6   r6   r7   view_no_columns)	  s   

z"TableNoColumnsTest.view_no_columnsc                 C   $   t dt |d}tt|jg  d S )NrH  r  r   r   r   rY  r   )rl   r}   rC  t2r6   r6   r7   test_reflect_table_no_columns9	  s   z0TableNoColumnsTest.test_reflect_table_no_columnsc                 C   s2   t |}t|dg  | }t|dg i d S )NrH  rA  )r   r   r   r  )rl   r}   rC  rs   multir6   r6   r7   !test_get_columns_table_no_columns=	  s   z4TableNoColumnsTest.test_get_columns_table_no_columnsc                 C   s*   t  }|| t|jdgsJ d S rA  )r   r,  r)  r   r  )rl   r}   rC  r-  r6   r6   r7   "test_reflect_incl_table_no_columnsC	  s   
z5TableNoColumnsTest.test_reflect_incl_table_no_columnsc                 C   rE  )Nempty_vr  rF  )rl   r}   rD  rG  r6   r6   r7   test_reflect_view_no_columnsH	  s   z/TableNoColumnsTest.test_reflect_view_no_columnsc                 C   s8   t |}t|dg  |jtjd}t|dg i d S )NrL  )r   )NrL  )r   r   r   r  r   r   )rl   r}   rD  rs   rI  r6   r6   r7    test_get_columns_view_no_columnsM	  s   z3TableNoColumnsTest.test_get_columns_view_no_columnsN)r9   r:   r;   __requires__r   r   r?  rC  rD  rH  rJ  rK  rG   r   rM  rN  r6   r6   r6   r7   r@   	  s    


r@  c                
   @   s   e Zd ZdZejdejjfdddejjdd Z	ejj
dd Zejjd	d
 Zdd Zejjdd Zejjdd Zejjdd Zejdddejjfdddejjfi ddejjfi ddejjfdddejjfdddejjfdddd ZdS )ComponentReflectionTestExtraTr  r  r   c              	      s   |rt j}nd }td|tdt tjdddtjddd|d td	|td
td|d || t	|}t
|jd|dtdd}dd   fdd|D }t|ddddddg d	}t|j||dg  d S )NZsa_ccr   za > 1 AND a < 5Zcc1r   za = 1 OR (a > 2 AND a < 5)Z
UsesCasingrE   r
  rB   r   r\   r  c                 S   s   d td|  tjS )N zand|\d|=|a|or|<|>)joinr  findallr  I)r  r6   r6   r7   	normalize~	  s   zJComponentReflectionTestExtra.test_get_check_constraints.<locals>.normalizec                    s"   g | ]}|d   |d dqS )r\   r  r\   r  r6   )r8  itemrU  r6   r7   ry  	  s    zKComponentReflectionTestExtra.test_get_check_constraints.<locals>.<listcomp>za = 1 or a > 2 and a < 5rV  za > 1 and a < 5)r   rI   r   r   r   r_   r   r   r4  r   r  r   r  r  r   )rl   rO   r}   r  rF   rs   r  r  r6   rX  r7   r   X	  sJ   



z7ComponentReflectionTestExtra.test_get_check_constraintsc              	      s  t d|tdtdtdtdtdtd}tdt|jj|jjt|jj	 dtdt
|jj td	|jj |  t }d	dgd
i dg} fdd}||d  G dd dt}G fdddt}tjjjrdg d|dd|dgd
d}	||	 |d|	 dd g|d dgd
d}
||
 ||
 t|d| t }t d| d}n&td t|d| t }t d| d}W d    n1 sw   Y  | || jj d S )Nr  xr   yzt_idxa  long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string long string Z
t_idx_longZt_idx_2F)r\   rs  r   rt  c                    s<   t jjjrg | d<  jj dg i| d< d S | di  d S )Nru  Z_includert  )r   rG   r  r0   r  r\   r%  )entryr  r6   r7   completeIndex	  s
   
zYComponentReflectionTestExtra.test_reflect_expression_based_indexes.<locals>.completeIndexr   c                   @   r`  )z[ComponentReflectionTestExtra.test_reflect_expression_based_indexes.<locals>.lower_index_strc                 S   s    |  }d|v od|v pd|v S )Nr  rY  rZ  r  )rl   rb  Zolr6   r6   r7   rc  	  s   zbComponentReflectionTestExtra.test_reflect_expression_based_indexes.<locals>.lower_index_str.__eq__Nrd  r6   r6   r6   r7   lower_index_str	  re  r`  c                       s   e Zd Z fddZdS )z^ComponentReflectionTestExtra.test_reflect_expression_based_indexes.<locals>.coalesce_index_strc                    s   d|  v o	 |v S )Ncoalescer_  ra  long_strr6   r7   rc  	  s   zeComponentReflectionTestExtra.test_reflect_expression_based_indexes.<locals>.coalesce_index_str.__eq__Nrd  r6   rb  r6   r7   coalesce_index_str	  s    rd  )Nr[  Nzlower(x)zlower(y))r\   rs  rv  r   zcoalesce(x, 'z')r  z>Skipped unsupported reflection of expression-based index t_idx)r   r   r   r!   r   r  r   rY  r[  rZ  ra  r4  r   r  r   rG   Z reflect_indexes_with_expressionsr0   insertr  r   r   r   r   Z!compare_table_index_with_expectedr  r\   )rl   rO   r}   r  rs   r  r^  r`  rd  Z
expr_indexZexpr_index_longm2rG  r6   )r}   rc  r7   %test_reflect_expression_based_indexes	  sn   &
		



zBComponentReflectionTestExtra.test_reflect_expression_based_indexesc                 C   s   t d|tdtdtdtd}td|jj}dg|j|jj d< |	| t
|}|d}t|ddgdgdtjdg t|d	 d
 d|jj  dg t dt |d}tt|jd	 j|jj d dg d S )Nr  rY  r   rZ  r\  includeF)r\   rs  ru  r   rt  r   rt  z
%s_includer  )r   r   r   r!   r   rY  rt  r  r\   r4  r   r   r   r(   r   r   rY  r  )rl   rO   r}   r  r   rs   r   rG  r6   r6   r7   test_reflect_covering_index	  sD   



z8ComponentReflectionTestExtra.test_reflect_covering_indexc                 G   sB   t d|gdd t|D R  }|| dd t|dD S )Nr  c                 S   s   g | ]\}}t d | |qS )zt%dr   )r8  r  type_r6   r6   r7   ry  
      zAComponentReflectionTestExtra._type_round_trip.<locals>.<listcomp>c                 S   r  )rK  r6   rw  r6   r6   r7   ry  
  r  )r   r  rp   r   r   )rl   r}   rO   r   r  r6   r6   r7   _type_round_trip
  s   
z-ComponentReflectionTestExtra._type_round_tripc                 C   sH   |  ||tddD ]}t|tjsJ t|jd t|jd qd S )N   r   )rl  r  r  r   r   	precisionscalerl   r}   rO   typr6   r6   r7   test_numeric_reflection!
  s   z4ComponentReflectionTestExtra.test_numeric_reflectionc                 C   s8   |  ||tdd }t|tjsJ t|jd d S )N4   r   )rl  r  r   r   r   lengthrp  r6   r6   r7   test_varchar_reflection*
  s   z4ComponentReflectionTestExtra.test_varchar_reflectionc              	   C   sT   t d|tdtddtdtdd}|| tdd t|dD ddd	 d S )
Nr  r   Tr   r  Fc                 S   r2  )r\   r   r6   r  r6   r6   r7   r<  <
  s    zIComponentReflectionTestExtra.test_nullable_reflection.<locals>.<dictcomp>)r   r  )r   r   r   rp   r   r   r   )rl   r}   rO   r  r6   r6   r7   test_nullable_reflection2
  s   
z5ComponentReflectionTestExtra.test_nullable_reflectionNZCASCADEzSET NULLz	NO ACTIONZRESTRICTzexpected,ondelete,onupdatec                    s"  i }|r||d< |r||d< |d u r|}t d|tdtdddd t d|tdtddtd	ttd
ddtdtddd t d|tdtddtdtdddtdttjdgdgfddi|dd || t|}|	dd d  t
 fdd D i  |	dd d  t
 | d S )NondeleteonupdaterY  r?   Tr@   r   r  Zx_idzx.idxidr   test
   userr\   rC   Fr   tidztable.idZmyfkr   r.   c                    s   i | ]} | r| | qS r6   r6   )r8  r   optsr6   r7   r<  
  rk  zMComponentReflectionTestExtra.test_get_foreign_key_options.<locals>.<dictcomp>)r   r   r   r   r   r_   r   r4  r   r   r   )rl   r}   rO   r  rw  rx  r.   rs   r6   r~  r7   test_get_foreign_key_optionsC
  sT   *	
z9ComponentReflectionTestExtra.test_get_foreign_key_options)r9   r:   r;   r   r   r   rG   rH   r   r   Zindexes_with_expressionsrg  r  ri  rl  r>  rr  ru  rv  Z1foreign_key_constraint_option_reflection_ondeleteZ1foreign_key_constraint_option_reflection_onupdateZ1fk_constraint_option_reflection_ondelete_noactionZ1fk_constraint_option_reflection_onupdate_restrictZ1fk_constraint_option_reflection_ondelete_restrictr  r6   r6   r6   r7   rP  U	  sh    5
Z
*



'rP  c                   @   s0   e Zd ZdZdZedd Zdd Zdd Zd	S )
NormalizedNameTest)Zdenormalized_namesTc                 C   sL   t tddd|tdtdd t tddd|tdtddtdtd d S )	Nt1Tr   r?   r@   rG  t1idzt1.id)r   r"   r   r   r   rN   r6   r6   r7   rP   
  s   

z NormalizedNameTest.define_tablesc                 C   s~   t  }ttddd|tjd}|jd }|jj|jj	sJ t  }|j
tjdd d |jd jj|jd jj	s=J d S )	NrG  Tr  r  r  c                 S   s   |   dv S )Nr  rG  r_  )r\   r-  r6   r6   r7   r   
  r7  zINormalizedNameTest.test_reflect_lowercase_forced_tables.<locals>.<lambda>)only)r   r   r"   r   r4   r   r   r  Z
referencesr?   r,  )rl   rf  Zt2_refZt1_refZm3r6   r6   r7   $test_reflect_lowercase_forced_tables
  s   

&z7NormalizedNameTest.test_reflect_lowercase_forced_tablesc                 C   sP   dd t tj D }t|d  |d   t|d  |d   d S )Nc                 S   s   g | ]
}|  d v r|qS )r  r_  r  r6   r6   r7   ry  
  s
    z;NormalizedNameTest.test_get_table_names.<locals>.<listcomp>r   r5  )r   r   r4   r  r   upperr  )rl   Z
tablenamesr6   r6   r7   r  
  s
   z'NormalizedNameTest.test_get_table_namesN)	r9   r:   r;   rO  r   r<   rP   r  r  r6   r6   r6   r7   r  
  s    
r  c                   @   s<   e Zd Zdd Zdd Zdd Zdd Zejj	d	d
 Z
dS )ComputedReflectionTestc                 C   s^   t tj}|d}dd |D }td|d d v  t|d d d  t|d d d  d S )	Ncomputed_default_tablec                 S   r  r   r6   rw  r6   r6   r7   r<  
  r  zLComputedReflectionTest.test_computed_col_default_not_set.<locals>.<dictcomp>Z42with_defaultrL  normalcomputed_col)r   r   r4   r   r'   r
   )rl   rs   rZ  Zcol_datar6   r6   r7   !test_computed_col_default_not_set
  s   

z8ComputedReflectionTest.test_computed_col_default_not_setc                 C   s   t tj}|d}dd |D }dD ]
}td|| v q|d }td|v  td|d v  t| |d d d td	|d v tjj	j
 tjj	j
r[t|d d	 tjjj
 d S d S )
Nr  c                 S   r  r   r6   rw  r6   r6   r7   r<  
  r  zKComputedReflectionTest.test_get_column_returns_computed.<locals>.<dictcomp>)r?   r  r  computedr  r  	normal+42	persisted)r   r   r4   r   r'   r   rU  r   rG   "computed_columns_reflect_persistedr0   "computed_columns_default_persisted)rl   rs   rZ  rB   r  compDatar6   r6   r7    test_get_column_returns_computed
  s&   




z7ComputedReflectionTest.test_get_column_returns_computedc                 C   s\   t d|| v  || d }t| |d | tjjjr,t d|v  t|d | d S d S )Nr  r  r  )r'   r   rU  r   rG   r  r0   r
   )rl   rB   columnr  r  r  r6   r6   r7   check_column
  s   
z#ComputedReflectionTest.check_columnc                 C   st   t tj}|d}dd |D }| |ddtjjj tjj	jr)| |ddd tjj
jr8| |d	d
d d S d S )Ncomputed_column_tablec                 S   r  r   r6   rw  r6   r6   r7   r<  
  r  zLComputedReflectionTest.test_get_column_returns_persisted.<locals>.<dictcomp>computed_no_flagr  computed_virtualznormal+2Fcomputed_storedz	normal-42T)r   r   r4   r   r  r   rG   r  r0   computed_columns_virtualcomputed_columns_storedrl   rs   rZ  rB   r6   r6   r7   !test_get_column_returns_persisted
  s0   



z8ComputedReflectionTest.test_get_column_returns_persistedc                 C   sz   t tj}|jdtjd}dd |D }| |ddtjjj	 tjj
j	r,| |ddd	 tjjj	r;| |d
dd d S d S )Nr  rE   c                 S   r  r   r6   rw  r6   r6   r7   r<    r  zXComputedReflectionTest.test_get_column_returns_persisted_with_schema.<locals>.<dictcomp>r  z	normal/42r  znormal/2Fr  z	normal*42T)r   r   r4   r   rI   r  r   rG   r  r0   r  r  r  r6   r6   r7   -test_get_column_returns_persisted_with_schema  s4   


zDComputedReflectionTest.test_get_column_returns_persisted_with_schemaN)r9   r:   r;   r  r  r  r  r   rG   rH   r  r6   r6   r6   r7   r  
  s    	r  c                   @   sH   e Zd Zd ZZdZdZedd Zdd Z	dd	 Z
ejjd
d ZdS )IdentityReflectionTestNT)Zidentity_columnsr>  c                 C   s   t d|tdttdtt  t d|tdttdddd	d
ddd tjjjr>t d|tdttdttdddtj	d d S d S )Nr  r  id1rG  id2Tr   r   r     alwaysstart	incrementminvaluemaxvaluecyclecacher   )r  r  rE   )
r   r   r   r   r   rG   rH   r0   r   rI   rN   r6   r6   r7   rP   3  s@   

z$IdentityReflectionTest.define_tablesc                 C   s   t jjjrXd}t|D ]}||vr|| q|rQtt|t| |D ]*}|dkr5t|| || k q$|dv rDt|| || k q$t|| || | q$d S t|| d S t|d |d  t|d |d  d S )Nr  r  >   r  r  r  r  )	r   rG   Zidentity_columns_standardr0   rY  rN  r   r  r'   )rl   r6  r  approxZcommon_keysr   r6   r6   r7   checkU  s$   
	
zIdentityReflectionTest.checkc                 C   s  t tj}|d|d }|D ]p}|d dkr td|v  q|d dkrQd|v r0t|d  t|d d  td|v  | j|d td	d
d
d
dd	d
ddd q|d dkrd|v rat|d  t|d d  td|v  | j|d tddddddddd	d qd S )Nr  rG  r\   r  identityr  rJ  rL  Fr5  r  Tr  r  r   r   r  r  r  )	r   r   r4   r   r&   r'   r   r  r3   rl   rs   rZ  ro   r6   r6   r7   test_reflect_identityr  sV   
		z,IdentityReflectionTest.test_reflect_identityc                 C   s   t tj}|jdtjd}|D ]?}|d dkrtd|v  q|d dkrNd|v r.t|d  t|d d  td|v  | j|d t	d	d
ddddddd	d qd S )Nr  rE   r\   r  r  r  rJ  rL  Tr   r5  r  Fr  r  )
r   r   r4   r   rI   r&   r'   r   r  r3   r  r6   r6   r7   test_reflect_identity_schema  s2   
	z3IdentityReflectionTest.test_reflect_identity_schema)r9   r:   r;   r9  r:  r   rO  r<   rP   r  r  r   rG   rH   r  r6   r6   r6   r7   r  -  s    
!,r  c                   @   s<   e Zd ZdZedd Zejjdd Z	ejj
dd ZdS )	CompositeKeyReflectionTestTc                 C   s   t d|tdttdttdtdtjdddddd dd	}t d
|tdtddtdttdttdtdtjg d|jj	|jj
|jjgddd dd		 d S )Ntb1r?   attrr\   r   Zpk_tb1r   Tr   tb2r@   pidpattrpnamer  r  r  Zfk_tb1_name_id_attr)r   r   r   r  ra   r_   r   r   r   r\   r?   r  )r5   rO   r  r6   r6   r7   rP     s2   

z(CompositeKeyReflectionTest.define_tablesc                 C   s0   t |}|| jjj}t|dg d d S )NrX  r\   r?   r  )r   r   r   r  r\   r   r  )rl   r}   rs   rA   r6   r6   r7   test_pk_column_order  s   z/CompositeKeyReflectionTest.test_pk_column_orderc                 C   sZ   t |}|| jjj}tt|d |d }t|dg d t|dg d d S )Nr5  r   rf  r  rX  r  )r   r   r   r  r\   r   r  r  )rl   r}   rs   Zforeign_keysr  r6   r6   r7   test_fk_column_order  s   z/CompositeKeyReflectionTest.test_fk_column_orderN)r9   r:   r;   r   r<   rP   r   rG   r=  r  r<  r  r6   r6   r6   r7   r    s    

r  )
r   rP  r@  r   r=   r   r  r  r  r  )Br  r  r1   r_   r   r   r   r   r   r   r   r	   r
   Z	provisionr   r   rF   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r   r   excr   r   r    r!   Zsql.elementsr"   Z
sql.schemar#   r$   r%   r&   r'   r(   rO   r   Z
TablesTestr*   r=   r   r   r   r   ZTestBaser@  rP  r  ZComputedReflectionFixtureTestr  r  r  __all__r6   r6   r6   r7   <module>   s    L               Y5  N+a 1