
    ؄_ص                        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\  Z$Z% G d de
j&                  Z' G d  d!e
j&                  Z( G d" d#e
j&                  Z) G d$ d%e
j&                  Z* G d& d'e
j+                  Z,d(Z-dS ))    N   )assert_raises_message)config)engines)eq_)expect_warnings)fixtures)is_)temp_table_keyword_argsColumn)Table   )event)exc)
ForeignKey)inspect)Integer)MetaData)String)testing)types)	Inspector)DDL)Index)quoted_name)is_false)is_true)NNc                   X    e Zd ZdZed             Zd Zej        j	        d             Z
dS )HasTableTestTc                 V   t          d|t          dt          d          t          dt          d                               t          j        j        j        rPt          d|t          dt          d          t          dt          d                    t          j	                   d S d S )	N
test_tableidTprimary_keydata2   test_table_sschema)
r   r   r   r   r   requiresschemasenabledr   test_schemaclsmetadatas     m/var/www/book.euthymeo.com/html/venv/lib/python3.11/site-packages/sqlalchemy/testing/suite/test_reflection.pydefine_tableszHasTableTest.define_tables&   s    4d33366"::&&		
 	
 	
 #+ 	tW$777vvbzz**)     	 	    c                    t           j                                        5 }t          t           j        j                            |d                     t          t           j        j                            |d                     t          t           j        j                            |d                     d d d            d S # 1 swxY w Y   d S )Nr"   r(   nonexistent_table)r   dbbeginr   dialect	has_tabler   selfconns     r2   test_has_tablezHasTableTest.test_has_table7   s    Y__ 	M$FI%//lCCDDDVY&00~FFGGGVY&007JKKLLL	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	Ms   BCC
Cc                    t           j                                        5 }t          t           j        j                            |dt           j                             t          t           j        j                            |dt           j                             t          t           j        j                            |dt           j                             d d d            d S # 1 swxY w Y   d S )Nr"   r)   r(   r6   )r   r7   r8   r   r9   r:   r.   r   r;   s     r2   test_has_table_schemaz"HasTableTest.test_has_table_schema=   s%   Y__ 	$	!++,v/A ,    
 	!++.1C ,    
 	!++-f6H ,    	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   B;C''C+.C+N)__name__
__module____qualname____backend__classmethodr3   r>   r   r+   r,   r@    r4   r2   r    r    #   sf        K  [ M M M     r4   r    c                      e Zd ZdZdZed             Zd Zed             Zee	j
        j        d                         Zed             Zed             Zed	             Zed
             Zee	j
        j        d                         Zee	j
        j        d                         Zee	j
        j        d                         ZdS )QuotedNameArgumentTestonceTc                 0   t          d|t          dt                    t          dt          d                    t          dt          d                    t          dt                    t	          j        dd          t	          j        d	d          t	          j        dd
          t	          j        dgdgd          t	          j	        dd          dd           t          j        j        j        rt          d|t          dt                    t          dt          d                    t          dt          d                    t          dt                    t	          j        dd          t	          j        dd          t	          j        dd          t	          j        dgdgd          t	          j	        dd          dd           t          d|t          dt          d          t          dt                    d           t          j        j        j        rt          j        j        j        rddg}ndg}|D ]}dt          j        j        j                            d|z            dt          j        j        j                            |          }t'          j        |dt+          |                     t'          j        |d t+          d!t          j        j        j                            d|z            z                       d S d S )"Nquote ' oner#   namer'   r&   
related_idzpk quote ' onerL   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$   rP   CREATE VIEW view %s AS SELECT * FROM after_createbefore_dropDROP VIEW %s)r   r   r   r   saPrimaryKeyConstraintr   UniqueConstraintForeignKeyConstraintCheckConstraintr   r+   symbol_names_w_double_quoter-   view_column_reflectionr7   r9   identifier_preparerquoter   listenr   )r0   r1   namesrL   querys        r2   r3   z$QuotedNameArgumentTest.define_tablesU   s7   4!!66"::&&66"::&&<))#D/?@@@H%v..$   #-=   5EFFF.%	
 	
 	
 	
* 7? 	tW%%vvbzz**vvbzz**|W--'3CDDD)622#(   'F\N1A   "?9JKKK2"%   * 	4d3339g&&	
 	
 	
 	
 2: 	;C !! "   J&:@@!D(    J&:@@FFF	 X~s5zzBBB!&!*,@FF%,  	 	 	 	)	 	 r4   c                 `     t          j        ddt           j        j        f          |           S )N)rK   rQ   )r   combinationsr+   r_   )fns    r2   quote_fixturesz%QuotedNameArgumentTest.quote_fixtures   s;    
w#G,HI
 
   	r4   c                 b    t          t          j                  }|                    |           d S N)r   r   r7   get_table_optionsr<   rL   insps      r2   test_get_table_optionsz-QuotedNameArgumentTest.test_get_table_options   s+    wz""t$$$$$r4   c                 l    t          t          j                  }|                    d|z            sJ d S )NrU   )r   r   r7   get_view_definitionrm   s      r2   test_get_view_definitionz/QuotedNameArgumentTest.test_get_view_definition   s8     wz""''	D(89999999r4   c                 f    t          t          j                  }|                    |          sJ d S rk   )r   r   r7   get_columnsrm   s      r2   test_get_columnsz'QuotedNameArgumentTest.test_get_columns   1    wz""%%%%%%%r4   c                 f    t          t          j                  }|                    |          sJ d S rk   )r   r   r7   get_pk_constraintrm   s      r2   test_get_pk_constraintz-QuotedNameArgumentTest.test_get_pk_constraint   s1    wz""%%d+++++++r4   c                 f    t          t          j                  }|                    |          sJ d S rk   )r   r   r7   get_foreign_keysrm   s      r2   test_get_foreign_keysz,QuotedNameArgumentTest.test_get_foreign_keys   s1    wz""$$T*******r4   c                 f    t          t          j                  }|                    |          sJ d S rk   )r   r   r7   get_indexesrm   s      r2   test_get_indexesz'QuotedNameArgumentTest.test_get_indexes   rv   r4   c                 f    t          t          j                  }|                    |          sJ d S rk   )r   r   r7   get_unique_constraintsrm   s      r2   test_get_unique_constraintsz2QuotedNameArgumentTest.test_get_unique_constraints   s3     wz""**40000000r4   c                 f    t          t          j                  }|                    |          sJ d S rk   )r   r   r7   get_table_commentrm   s      r2   test_get_table_commentz-QuotedNameArgumentTest.test_get_table_comment   s3     wz""%%d+++++++r4   c                 f    t          t          j                  }|                    |          sJ d S rk   )r   r   r7   get_check_constraintsrm   s      r2   test_get_check_constraintsz1QuotedNameArgumentTest.test_get_check_constraints   s3     wz""))$///////r4   N)rA   rB   rC   run_create_tablesrD   rE   r3   ri   ro   r   r+   r`   rr   ru   ry   r|   r   unique_constraint_reflectionr   comment_reflectionr   check_constraint_reflectionr   rF   r4   r2   rH   rH   Q   s       KQ Q [Qf   % % ^%
 ,: : -, ^: & & ^& , , ^, + + ^+ & & ^& 21 1 32 ^1 (, , )( ^, 10 0 21 ^0 0 0r4   rH   c                   <   e Zd ZdxZZdZed             Zed             Zed             Z	ed             Z
ed             Zed             Zej        j        d	             Zej        j        d
             Zej        j        d             Zej        	 dHd            Zej        j        d             Zej        j        ej        j        ej        j        d                                     Zej        j        d             Zej        j        ej        j        d                         Zej        j        d             Zej        j        ej        j         d                         Z!dIdZ"ej        j        ej        j         d                         Z#ej        j$        d             Z%ej        j$        ej        j         d                         Z&ej        j        ej        j$        d                         Z'dJdZ(ej        j        d             Z)ej        d             Z*ej        j        d             Z+ej        j        d             Z,ej        j        ej        d                         Z-ej        j        ej        j         d                         Z.ej        j/        d              Z0ej        j/        ej        j$        ej        j        d!                                     Z1ej        j$        d"             Z2ej        j$        ej        j         d#                         Z3ej        dId$            Z4ej        j5        d%             Z6ej        j        ej        j5        ej        j         d&                                     Z7ej        j        ej        d'                         Z8ej        dId(            Z9ej        j        d)             Z:ej        j        ej        j         d*                         Z;ej        j<        ej        j         d+                         Z=ej        j>        d,             Z?ej        j@        d-             ZAej        d.             ZBd/ ZCej        dId0            ZDej        jE        d1             ZFej        jE        ej        j         d2                         ZGej        d3             ZHej        jE        ej        jI        d4                         ZJej        jE        ej        jI        d5                         ZKej        jL        ej        d6                         ZMej        jN        d7             ZOej        j/        ej        jN        d8                         ZPej        j/        d9             ZQej        jN        ej        j         d:                         ZRej        dId;            ZSej        jT        d<             ZUej        jT        ej        j         d=                         ZVej        dId>            ZWej        dId?            ZXej        j        d@             ZYej        j        ej        j         dA                         ZZ ej[        dBdC          ej        dIdD                        Z\dE Z]ej        j         dF             Z^ej        j        ej        dG                         Z_dS )KComponentReflectionTestNTc                     t           j        j        j        r.ddlm} t          j        t          |j	                            S t           j
        S )Nr   )pool)	poolclass)options)r   requirementsindependent_connectionsr-   
sqlalchemyr   r   testing_enginedict
StaticPoolr7   )r0   r   s     r2   
setup_bindz"ComponentReflectionTest.setup_bind   sY    6> 	'''''')t777    9r4   c                     |                      |d            t          j        j        j        r'|                      |t          j        j                   d S d S rk   )define_reflected_tablesr   r+   r,   r-   r   r.   r/   s     r2   r3   z%ComponentReflectionTest.define_tables   sW    ##Hd333#+ 	N'''.2LMMMMM	N 	Nr4   c                 ~   |r|dz   }nd}t           j        j        j        rt	          d|t          dt          j        d          t          dt          j        d          d	
          t          dt          j	        d          d	
          t          dt          j
        t          j        d|z  d                    |d          }ntt	          d|t          dt          j        d          t          dt          j        d          d	
          t          dt          j	        d          d	
          |d          }t	          d|t          dt          j
        d          t          dt          j
        t          j        d|z                      t          dt          j        d                    |d           t	          d|t          dt          j
                  t          dt          j
        t          j        |j        j                            t          dt          j        d                    t          j        dd          |d           t	          d|t          dt          j
        dd          t          dt          j        d          d !          t          d"t          j        d          d#!          |d$%           t           j        j        j        re|t	          d&|t          dt          j
        d          t          dt          j        d                    t          d't          d(t           j        j        z                      dt"          j        j        j        )           nt	          d*|t          dt          j
        d          t          d+t          d,t"          j        j        j        z                      t          dt          j        d                    |d           t	          d-|t          dt          j
        d          t          dt          j        d                    |d           t           j        j        j        r|                     ||           |st	          d.|t          d/t          j        d                    d0          }t	          d1|t          dt          j
        d          t          d/t          j        d                    d0          }t           j        j        j        rXt3          d2|j        j                                                   t3          d3|j        j                                                   t           j        j        j        r|                     ||           |s-t           j        j        j        r|                     |           d S d S d S )4N. usersuser_idTr$   test1   Fnullabletest2parent_user_idz%susers.user_id
user_id_fkrN   )r*   rP   
dingalingsdingaling_id
address_idz%semail_addresses.address_idr&      email_addressesremote_user_idemail_address   email_ad_pkcomment_testr#   
id comment)r%   rO   data % comment)rO   d2)Comment types type speedily ' " \ '' Fun!the test % ' " \ table comment)r*   rO   local_table	remote_idz%s.remote_table_2.id)rP   r*   remote_tablelocal_idz%s.local_table.idremote_table_2noncol_idx_test_nopkqrS   noncol_idx_test_pknoncol_idx_nopknoncol_idx_pk) r   r+   self_referential_foreign_keysr-   r   r   rZ   INTCHARFloatr   r   r   cr   r[   cross_schema_fk_reflectionr   r.   r7   r9   default_schema_nameindex_reflectiondefine_indexindexes_with_ascdescr   r   descr`   define_viewstemp_table_reflectiondefine_temp_tables)r0   r1   r*   schema_prefixr   r   r   s          r2   r   z/ComponentReflectionTest.define_reflected_tables   s    	"SLMMM9A 	y"&d;;;w

U;;;we<<<$JM)M9    "  EE" y"&d;;;w

U;;;we<<<"  E 	>2:4@@@
<}LMM 
 629R==))	
 	
 	
 	
 	<,, "*bmEGO.L.L  ?BIbMM22#L}EEE	
 	
 	
 	
 	4|LLL629R==2BCCC	"H  
 9	
 	
 	
 	
 6> '	~!4>>>629R==11#"2W^5OO   #'!9,@     "4>>>""/$i/CD   629R==11!"&    $4>>>629R==11!"&    ,4 	JXu--- J',*3	!--"&	( ( ($ &+(4>>>3	!--"&& & &" #8@ J+-A-C-E-J-J-L-LMMM/+=+?+A+F+F+H+HIII2: 	/Xv... 	-'*@H 	-""8,,,,,	- 	- 	- 	-r4   c                 H   t          t          t          j                  }t          d|t	          dt
          j        d          t	          dt          j        d                    t	          dt
          j                  t          j        dd	          t          j	        d
d          fi |}t          j        j        j        r^t          j        j        j        rJt          j        |dt#          d                     t          j        |dt#          d                     d S d S d S )Nuser_tmpr#   Tr$   rL   r'   foouser_tmp_uqrN   user_tmp_ixrW   z:create temporary view user_tmp_v as select * from user_tmprX   zdrop view user_tmp_v)r   r   r7   r   r   rZ   r   VARCHARr\   r   r   r+   view_reflectionr-   temporary_viewsr   rc   r   )r0   r1   kwr   s       r2   r   z*ComponentReflectionTest.define_temp_tables  s"   $VVY774T22262:b>>**5"&!!];;;H]E**	
 	
 	
 	
 ,4	O 08	O L-    L=#6L2M2MNNNNN	O 	O 	O 	Or4   c                     t          d|j        j        |j        j                   t          d|j        j        |j        j        |j        j                   d S )Nusers_t_idxusers_all_idx)r   r   r   r   r   )r0   r1   r   s      r2   r   z$ComponentReflectionTest.define_index  sB    mUW]EGM:::ouwuw}MMMMMr4   c           	          dD ]c}|}|r|d|}|dz   }d|d|}t          j        |dt          |                     t          j        |dt          d|z                       dd S )	N)r   r   r   _vrT   rV   rW   rX   rY   )r   rc   r   )r0   r1   r*   
table_namefullname	view_namere   s          r2   r   z$ComponentReflectionTest.define_views  s    6 	 	J!H :&,ffjj9 4II		E
 L>3u::>>>L-^i-G)H)H   	 	r4   c                     t          t          j                  }|                     t          j        j        |                                v            d S rk   )r   r   r7   assert_r   r.   get_schema_namesr<   rn   s     r2   test_get_schema_namesz-ComponentReflectionTest.test_get_schema_names  s?    wz""W^/43H3H3J3JJKKKKKr4   c                     t          j                    }t          |j        d          rJ t	          |           t          |j        d          sJ d S )Nr   )r   r   hasattrr9   r   )r<   engines     r2   test_dialect_initializez/ComponentReflectionTest.test_dialect_initialize  sS    '))6>+@AAAAAv~'<=======r4   c                     t          t          j                  }t          |j        t          j        j        j                   d S rk   )r   r   r7   r   r   r9   r   s     r2   test_get_default_schema_namez4ComponentReflectionTest.test_get_default_schema_name  s2    wz""D$gj&8&LMMMMMr4   tablec                   	 g d	| j         }t          |j                  }|dk    rL|                    |          }|                                 ddg}t          t          |          |           d S |r d |                    |          D             }n|                    |          }	fd|D             }|dk    rg d}t          ||           d S g d	}t          t          |          |           d S )
N)r   r   r   r   r   r   viewemail_addresses_vusers_vc                 .    g | ]}|d          
|d          S )r   rF   .0recs     r2   
<listcomp>zAComponentReflectionTest._test_get_table_names.<locals>.<listcomp>  s6       1vF  r4   c                     g | ]}|v|	S rF   rF   )r   t_ignore_tabless     r2   r   zAComponentReflectionTest._test_get_table_names.<locals>.<listcomp>  s#    HHH0G0G10G0G0Gr4   foreign_key)r   r   r   )r   r   r   )	r1   r   bindget_view_namessortr   sortedget_sorted_table_and_fkc_namesget_table_names)
r<   r*   
table_typeorder_bymetarn   table_namesanswertablesr   s
            @r2   _test_get_table_namesz-ComponentReflectionTest._test_get_table_names  s=   
 
 
 }ty!!--f55K)95F{##V,,,,, 6 #BB6JJ   --f55HHHHfHHHK=((CCCK(((((CCCF;''00000r4   c                     t          | j                  }|                                }t          t	          |          dg           d S )Nr   )r   r   get_temp_table_namesr   r   r<   rn   temp_table_namess      r2   test_get_temp_table_namesz1ComponentReflectionTest.test_get_temp_table_names  sD    ty!!4466F#$$zl33333r4   c                     t          | j                  }|                                }t          t	          |          dg           d S )N
user_tmp_v)r   r   get_temp_view_namesr   r   r	  s      r2   test_get_temp_view_namesz0ComponentReflectionTest.test_get_temp_view_names  sF     ty!!3355F#$$|n55555r4   c                 .    |                                   d S rk   r  r<   s    r2   test_get_table_namesz,ComponentReflectionTest.test_get_table_names   s    ""$$$$$r4   c                 2    |                      d           d S )Nr   )r  r  r  s    r2   test_get_table_names_fksz0ComponentReflectionTest.test_get_table_names_fks  s!     	""M":::::r4   c                 .    |                                   d S rk   )_test_get_commentsr  s    r2   test_get_commentsz)ComponentReflectionTest.test_get_comments	  s    !!!!!r4   c                 N    |                      t          j        j                   d S rk   )r  r   r   r.   r  s    r2   test_get_comments_with_schemaz5ComponentReflectionTest.test_get_comments_with_schema  s#     	 :;;;;;r4   c                 J   t          t          j                  }t          |                    d|          ddi           t          |                    d|          dd i           t          d |                    d|          D             ddd	d
dd	ddd	g           d S )Nr   r)   textr   r   c                 0    g | ]}|d          |d         dS )rL   rO   )rL   rO   rF   r   s     r2   r   z>ComponentReflectionTest._test_get_comments.<locals>.<listcomp>  s8        VY@@  r4   r   r#   )rO   rL   r   r&   r   r   )r   r   r7   r   r   rt   )r<   r*   rn   s      r2   r  z*ComponentReflectionTest._test_get_comments  s    wz"""">&"AA:;	
 	
 	

 	D""76"::VTNKKK ++N6+JJ  
 )$77,f== I 	 		
 	
 	
 	
 	
r4   c                 N    |                      t          j        j                   d S rk   r  r   r   r.   r  s    r2    test_get_table_names_with_schemaz8ComponentReflectionTest.test_get_table_names_with_schema-  s#     	""7>#=>>>>>r4   c                 2    |                      d           d S Nr   )r   r  r  s    r2   test_get_view_namesz+ComponentReflectionTest.test_get_view_names2  s    ""f"55555r4   c                 R    |                      t          j        j        d           d S r"  r  r  s    r2   test_get_view_names_with_schemaz7ComponentReflectionTest.test_get_view_names_with_schema6  s5     	""N&6 	# 	
 	
 	
 	
 	
r4   c                 Z    |                                   |                      d           d S r"  r  r  s    r2   test_get_tables_and_viewsz1ComponentReflectionTest.test_get_tables_and_views=  s3     	""$$$""f"55555r4   c                    t          t          j                  }| j        j        | j        j        }}ddg}|dk    rddg}t          |j                  }t          |||f          D ]\  }}	|}
|	                    ||
          }| 
                    t          |          dk    t          |                     t          |	j                  D ]\  }}t          |j        ||         d                    ||         d	         j        }|j        }t%          |t&          j        j                  r|j        }t          j        d
          r&|t.          j        t.          j        fv rt.          j        }| 
                    t          t5          |j                                      |j                                      t.          j        t.          j        t.          j        t.          j        t.          j        t.          j         t.          j!        g                    dk    |j        d|j        d||         d         d|d           |j"        s||         d         J d S )Nr   r   r   r   r   r)   r   rL   typeoracle(z), )default)#r   r   r7   r  r   r   r   r   ziprt   r   len	enumeratecolumnsr   rL   	__class__r)  
isinstancerZ   r   
TypeEngineagainst	sql_typesDateDateTimeset__mro__intersectionr   NumericTimer   _Binaryr%   )r<   r*   r   r  r   	addressesr  rn   r   r   schema_namecolsicolctype	ctype_defs                   r2   _test_get_columnsz)ComponentReflectionTest._test_get_columnsC  sG   
## K-t{/Jy 12$&9:Kty!!!$[5)2D!E!E /	6 /	6J K##J{#CCDLLTQD		222 $EM22 (6 (63CHd1gfo...Q1H	i)<== 4 ) 3I ?8,, /N&? 2 2 !*I
 EM**%i&788% ) 1 ) 1 ) 2 ) ) ) 0 ) 1
 
  " xxx476???EEEC#  *  679-555Q(6/	6 /	6r4   c                 .    |                                   d S rk   rF  r  s    r2   ru   z(ComponentReflectionTest.test_get_columns{           r4   c                     t          d| j        gd t          |          D             R  }|                                 d t	          | j        j                                      d          D             S )Nr   c                 :    g | ]\  }}t          d |z  |          S )zt%dr   )r   rB  type_s      r2   r   z<ComponentReflectionTest._type_round_trip.<locals>.<listcomp>  s*    HHH81efUQY&&HHHr4   c                     g | ]
}|d          S )r)  rF   r   r   s     r2   r   z<ComponentReflectionTest._type_round_trip.<locals>.<listcomp>  s)     
 
 
AfI
 
 
r4   )r   r1   r0  creater   r   rt   )r<   r   r   s      r2   _type_round_tripz(ComponentReflectionTest._type_round_trip  s    M
 IHy7G7GHHH
 
 

 	




 
&t}'9::FFsKK
 
 
 	
r4   c                     |                      t          j        dd                    D ]H}t          |t          j                  sJ t	          |j        d           t	          |j        d           Id S )N   r   )rP  r6  r<  r3  r   	precisionscaler<   typs     r2   test_numeric_reflectionz/ComponentReflectionTest.test_numeric_reflection  sv    (():2q)A)ABB 	 	Cc9#455555r"""	1	 	r4   c                     |                      t          j        d                    d         }t          |t          j                  sJ t	          |j        d           d S )N4   r   )rP  r6  r   r3  r   lengthrU  s     r2   test_varchar_reflectionz/ComponentReflectionTest.test_varchar_reflection  sV    ##I$4R$8$899!<#y/00000CJr4   c           
      X   t          d| j        t          dt          d          t          dt          d                    }|                                 t          t          d t          | j        j                  	                    d          D                       ddd           d S )	Nr   aTr   bFc              3   6   K   | ]}|d          |d         fV  dS )rL   r   NrF   r   rC  s     r2   	<genexpr>zCComponentReflectionTest.test_nullable_reflection.<locals>.<genexpr>  sC         Vc*o.     r4   )r]  r^  )
r   r1   r   r   rO  r   r   r   r   rt   )r<   r   s     r2   test_nullable_reflectionz0ComponentReflectionTest.test_nullable_reflection  s     M3$///3%000	
 
 	



  "4=#566BB3GG     U##	
 	
 	
 	
 	
r4   c                 P    |                      t          j        j                   d S Nr)   rF  r   r   r.   r  s    r2   test_get_columns_with_schemaz4ComponentReflectionTest.test_get_columns_with_schema  &     	gn&@AAAAAr4   c                 v   t          | j                  }| j        j        }t	          |j                  }|                    d          }|                     t          |          dk    t          |                     t          |j	                  D ]&\  }}t          |j        ||         d                    'd S )Nr   r   rL   )r   r   r  r   r   rt   r   r/  r0  r1  r   rL   )r<   r  r   rn   rA  rB  rC  s          r2   test_get_temp_table_columnsz3ComponentReflectionTest.test_get_temp_table_columns  s    	"";'ty!!
++SYY]CII... 011 	+ 	+FAs$q'&/****	+ 	+r4   c                     t          | j                  }|                    d          }t          d |D             g d           d S )Nr  c                     g | ]
}|d          S rN   rF   r`  s     r2   r   zFComponentReflectionTest.test_get_temp_view_columns.<locals>.<listcomp>  s    )))SS[)))r4   )r#   rL   r   )r   r   rt   r   )r<   rn   rA  s      r2   test_get_temp_view_columnsz2ComponentReflectionTest.test_get_temp_view_columns  sR     ty!!--))D)))+@+@+@AAAAAr4   c                 2    |                      d           d S r"  rH  r  s    r2   test_get_view_columnsz-ComponentReflectionTest.test_get_view_columns  s    &11111r4   c                 R    |                      t          j        j        d           d S )Nr   )r*   r   re  r  s    r2   !test_get_view_columns_with_schemaz9ComponentReflectionTest.test_get_view_columns_with_schema  s5     	>-& 	 	
 	
 	
 	
 	
r4   c                    | j         }| j        j        | j        j        }}t	          |j                  }|                    |j        |          }|d         }t          |dg           |                    |j        |          }|d         }	t          |	dg           t          j
        j                                        5  t          |d         d           d d d            d S # 1 swxY w Y   d S )Nr)   constrained_columnsr   r   rL   r   )r1   r  r   r   r   r   rx   rL   r   r   r+   reflects_pk_namesfail_if)
r<   r*   r  r   r?  rn   
users_consusers_pkeys	addr_cons
addr_pkeyss
             r2   _test_get_pk_constraintz/ComponentReflectionTest._test_get_pk_constraint  s*   };,dk.Iyty!!++EJv+FF
 !67K)%%%**9>&*II	45
J'''/7799 	2 	2	&!=111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2s   C%%C),C)c                 .    |                                   d S rk   )ry  r  s    r2   ry   z.ComponentReflectionTest.test_get_pk_constraint  s    $$&&&&&r4   c                 P    |                      t          j        j                   d S rd  )ry  r   r   r.   r  s    r2   "test_get_pk_constraint_with_schemaz:ComponentReflectionTest.test_get_pk_constraint_with_schema  s&     	$$GN,F$GGGGGr4   c                     | j         }| j        j        }t          |j                  }t          t          j        d|j        |j	                   d S )Nz+.*get_primary_keys\(\) method is deprecated)
r1   r  r   r   r   r   sa_excSADeprecationWarningget_primary_keysrL   )r<   r  r   rn   s       r2    test_deprecated_get_primary_keysz8ComponentReflectionTest.test_deprecated_get_primary_keys  sT     }!##':!J		
 	
 	
 	
 	
r4   c                 &   | j         }| j        j        | j        j        }}t	          |j                  }|}t          j        j        j	        r|
                    |j        |          }|d         }t          j        j                                        5  t          |d         d           d d d            n# 1 swxY w Y   t          |d         |           t          |d         |j                   t          |d         dg           t          j        j        j	        rt          |d	         d
g           |
                    |j        |          }	|	d         }t          j        j                                        5  |                     |d         d u           d d d            n# 1 swxY w Y   t          |d         |           t          |d         |j                   t          |d         dg           t          |d	         dg           d S )Nr)   r   rL   r   referred_schemareferred_tablereferred_columnsr   rr  r   r   )r1   r  r   r   r   r   r   r+   r   r-   r{   rL   named_constraintsrt  r   implicitly_named_constraintsr   )
r<   r*   r  r   r?  rn   expected_schemausers_fkeysfkey1
addr_fkeyss
             r2   _test_get_foreign_keysz.ComponentReflectionTest._test_get_foreign_keys  sq   } K-t{/Jyty!!  9A 	F//
6/JJKNE!3;;== 1 1E&M<0001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 '(/:::&'444()I;777=E FE/03C2DEEE **9>&*II
1:BBDD 	4 	4LLvd2333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	E#$o666E"#UZ000E$%	{333E'(+;*<=====s$   B66B:=B:=F''F+.F+c                 .    |                                   d S rk   )r  r  s    r2   r|   z-ComponentReflectionTest.test_get_foreign_keys  s    ##%%%%%r4   c                 P    |                      t          j        j                   d S rd  )r  r   r   r.   r  s    r2   !test_get_foreign_keys_with_schemaz9ComponentReflectionTest.test_get_foreign_keys_with_schema  s&     	##7>+E#FFFFFr4   c                    |                      dt          j        j        j        z  dt          j        j        z  dt          j        j        z            \  }}}t          t
          j                  }|                    |j	                  }t          t          |          d           |d         }t          |d         t          j        j                   t          |d         |j	                   t          |d         d	g           t          |d
         dg           |                    |j	        t          j        j                  }t          t          |          d           |d         }|d         d t          j        j        j        fv sJ t          |d         |j	                   t          |d         d	g           t          |d
         dg           d S )Nz%s.local_tablez%s.remote_tablez%s.remote_table_2   r   r  r  r  r#   rr  r   r)   r   )r  r   r7   r9   r   r   r.   r   r{   rL   r   r/  )	r<   r   r   r   rn   local_fkeysr  remote_fkeysfkey2s	            r2   "test_get_inter_schema_foreign_keysz:ComponentReflectionTest.test_get_inter_schema_foreign_keys   s    59KKwz1EE ::'."<<5
 5
1\> vy!!++K,<==Ca   AE#$gn&@AAAE"#^%8999E$%v...E'(;-888,,gn&@ - 
 
 	Cq!!!Q&'J2,
 
 
 
 
 	E"#[%5666E$%v...E'(:,77777r4   c                 2    |                      d           d S )NCASCADE)ondelete_test_get_foreign_key_optionsr  s    r2   %test_get_foreign_key_options_ondeletez=ComponentReflectionTest.test_get_foreign_key_options_ondeleteC  s    **I*>>>>>r4   c                 2    |                      d           d S )NzSET NULL)onupdater  r  s    r2   %test_get_foreign_key_options_onupdatez=ComponentReflectionTest.test_get_foreign_key_options_onupdateG  s    **J*?????r4   c                    | j         }t          d|t          dt          d          d           t          d|t          dt          d          t          dt          t	          j        dd	
                    t          dt          d                    d           t          d|t          dt          d          t          dt          d          d          t          dt                    t	          j        dgdgfddi|d           |                                 t          |j
                  }|                    d          d         d         t          t          fdD                       i            |                    d          d         d         t          t          fdD                       |           d S )Nxr#   Tr$   rS   r   x_idzx.idxidrN   test
   userrL   r'   Fr   tidztable.idmyfkr   r   c              3   <   K   | ]}|         
||         fV  d S rk   rF   r   koptss     r2   ra  zHComponentReflectionTest._test_get_foreign_key_options.<locals>.<genexpr>s  4      77!tAw7!T!W777777r4   c              3   <   K   | ]}|         
||         fV  d S rk   rF   r  s     r2   ra  zHComponentReflectionTest._test_get_foreign_key_options.<locals>.<genexpr>v  r  r4   )r1   r   r   r   rZ   r   r   r]   
create_allr   r   r{   r   r   )r<   r   r  rn   r  s       @r2   r  z5ComponentReflectionTest._test_get_foreign_key_optionsK  s   }4d333		
 	
 	
 	
 	4d33367BM&u$E$E$EFF66"::&&	
 	
 	
 	
 	4d33366"::6665'""#* ,26=  
	
 
	
 
	
 
	
 	ty!! $$W--a0;D7777t77777<<<$$V,,Q/	:D7777t77777AAAAAr4   c                     d |D             }|D ]P}|d         |v sJ ||                     |d                            }|D ]}t          ||         ||                    Qd S )Nc                     g | ]
}|d          S rN   rF   )r   ds     r2   r   z@ComponentReflectionTest._assert_insp_indexes.<locals>.<listcomp>y  s    222Qqy222r4   rL   )indexr   )r<   indexesexpected_indexesindex_namese_indexr  keys          r2   _assert_insp_indexesz,ComponentReflectionTest._assert_insp_indexesx  s    22'222' 	. 	.G6?k1111K--gfo>>?E . .GCL%*----.	. 	.r4   c                     | j         }t          |j                  }|                    d|          }dddgdddg dd	dg}|                     ||           d S )
Nr   r)   Fr   r   r   uniquecolumn_namesrL   )r   r   r   r   )r1   r   r   r~   r  )r<   r*   r  rn   r  r  s         r2   _test_get_indexesz)ComponentReflectionTest._test_get_indexes  s    } ty!!""76"::  !(' 2%    = = =' 
 	!!'+;<<<<<r4   c                 .    |                                   d S rk   )r  r  s    r2   r   z(ComponentReflectionTest.test_get_indexes  rI  r4   c                 P    |                      t          j        j                   d S rd  )r  r   r   r.   r  s    r2   test_get_indexes_with_schemaz4ComponentReflectionTest.test_get_indexes_with_schema  rg  r4   c                    | j         }t          |j                  }|                    |          }d|dg}|                     ||           t          |||j                  }t          t          |j                  d           t          t          |j                  d         j        |           t          t          |j                  d         j        |           d S )NF)r  rL   )autoload_withr  r   )r1   r   r   r~   r  r   r   r/  r  r
   listr   rL   )r<   tnameixnamer  rn   r  r  r   s           r2   _test_get_noncol_indexz.ComponentReflectionTest._test_get_noncol_index  s    }ty!!""5))
 (-f==>!!'+;<<<%TY777C	NNADOOA$a(((DOOA#V,,,,,r4   c                 2    |                      dd           d S )Nr   r   r  r  s    r2   test_get_noncol_index_no_pkz3ComponentReflectionTest.test_get_noncol_index_no_pk  s"     	##$:<MNNNNNr4   c                 2    |                      dd           d S )Nr   r   r  r  s    r2   test_get_noncol_index_pkz0ComponentReflectionTest.test_get_noncol_index_pk  s!     	##$8/JJJJJr4   c                 F   t          d| j        t          dt          d                    t          dt          d                               t	          j        | j        dt          d                     t	          j        | j        dt          d                     | j                                         t          | j        j	                  }t          d          5  t          |                    d          d	dgd
dg           d d d            d S # 1 swxY w Y   d S )Nr   r  r   yrW   z+CREATE INDEX t_idx ON t(lower(x), lower(y))zCREATE INDEX t_idx_2 ON t(x)z>Skipped unsupported reflection of expression-based index t_idxt_idx_2r   )rL   r  r  )r   r1   r   r   r   rc   r   r  r   r   r   r   r~   r   s     r2   %test_reflect_expression_based_indexesz=ComponentReflectionTest.test_reflect_expression_based_indexes  sl    	M3r

##3r

##		
 	
 	
 	M=>>	
 	
 	

 	M>3/M+N+N	
 	
 	
 	  """t})**L
 
 	 	   %%#cUaHHI  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   *DDDc                 .    |                                   d S rk   )_test_get_unique_constraintsr  s    r2   r   z3ComponentReflectionTest.test_get_unique_constraints  s    ))+++++r4   c                     t          | j                  }|                    d          }|D ]}|                    dd            t	          |dgddg           d S )Nr   duplicates_indexrL   r   )r  rL   )r   r   r   popr   )r<   rn   	reflectedrefls       r2   &test_get_temp_table_unique_constraintsz>ComponentReflectionTest.test_get_temp_table_unique_constraints  sr     ty!!//
;;	 	/ 	/D HH'....I&=IIJKKKKKr4   c                     t          | j                  }|                    d          }|D ]}|                    dd            t	          d |D             ddgddg           d S )Nr   dialect_optionsc                 *    g | ]}|d          dk    |S )rL   r   rF   r   idxs     r2   r   zGComponentReflectionTest.test_get_temp_table_indexes.<locals>.<listcomp>  s&    DDDSs6{m'C'CS'C'C'Cr4   Fr   r   r  )r   r   r~   r  r   )r<   rn   r  inds       r2   test_get_temp_table_indexesz3ComponentReflectionTest.test_get_temp_table_indexes  s    ty!!"":.. 	- 	-CGG%t,,,, EDGDDD $%*G) 		
 	
 	
 	
 	
r4   c                 P    |                      t          j        j                   d S rd  )r  r   r   r.   r  s    r2   'test_get_unique_constraints_with_schemaz?ComponentReflectionTest.test_get_unique_constraints_with_schema  s&     	))1K)LLLLLr4   c                 `   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          j        d                    }| j        }t	          d|t          dt          j        d                    t          dt          j        d                    t          dt          j                  t          d	t          j        d                    t          d
t          j        d                    |          }|D ]2}|	                    t          j
        |d         d|d         i           3|                                 t          |j                  }t          |                    d|          t          j        d                    }t                      }t!          ||          D ]B\  }	}
|
                    dd           }|r|                    |           t'          |	|
           Ct)                      }t	          d||j        |          }t          d |j        D                       }t          d |j        D                                           dg          }|                    |          rJ |r.t'          ||           t'          |t                                 d S d S )Nunique_ar]  )rL   r  unique_a_b_c)r]  r^  r   unique_c_a_b)r   r]  r^  unique_asc_keyascr  zi.have.dotsr^  zi have spacesr   rL   r  testtblr   r   r)   r  r  )r  r*   c                     g | ]	}|j         
S rF   rN   r  s     r2   r   zHComponentReflectionTest._test_get_unique_constraints.<locals>.<listcomp>?  s    ???c???r4   c                 P    g | ]#}t          |t          j                  |j        $S rF   )r3  rZ   r\   rL   )r   uqs     r2   r   zHComponentReflectionTest._test_get_unique_constraints.<locals>.<listcomp>A  s=       b""566  r4   )r   operator
itemgetterr1   r   r   rZ   r   r   append_constraintr\   r  r   r   r   r9  r.  r  addr   r   r  constraints
differencer;  )r<   r*   uniques	orig_metar   uc	inspectorr  names_that_duplicate_indexorigr  dupereflected_metadata	idx_namesuq_namess                  r2   r  z4ComponentReflectionTest._test_get_unique_constraints  s    #cU;;'II'II)E5>JJ&>>(3%@@ #F++

 

 

 M	3	"&&3	"&&3
##5")B--((5")B--((

 

 

  	 	B###R%7IbjII    	IN++	,,Yv,FF#F++
 
 
	
 &)UU"gy11 	 	JD$ 88.55D 5*..t444dOOOO%ZZ#.	
 
 
	 ??Y->???@@	 #/  
 
 *n%
&
& 	 ))(33333% 	!*I666#%%     	! 	!r4   c                 .    |                                   d S rk   )_test_get_check_constraintsr  s    r2   r   z2ComponentReflectionTest.test_get_check_constraintsM  s    ((*****r4   c                 P    |                      t          j        j                   d S rd  )r  r   r   r.   r  s    r2   !test_get_check_constraints_schemaz9ComponentReflectionTest.test_get_check_constraints_schemaQ  s&     	((0J(KKKKKr4   c           
         | j         }t          d|t          dt                                t	          j        dd          t	          j        dd          |           |                                 t          |j                  }t          |
                    d|          t          j        d	          
          }d fd|D             }t          |ddddddg           d S )Nsa_ccr]  za > 1 AND a < 5cc1rN   za = 1 OR (a > 2 AND a < 5)cc2r)   rL   r  c                     d                     t          j        d|                                 t          j                            S )N zand|\d|=|a|or|<|>)joinrefindalllowerI)sqltexts    r2   	normalizezFComponentReflectionTest._test_get_check_constraints.<locals>.normalizem  s4    88
/"$GG  r4   c                 D    g | ]}|d           |d                   dS )rL   r  rL   r  rF   )r   itemr  s     r2   r   zGComponentReflectionTest._test_get_check_constraints.<locals>.<listcomp>r  sC     
 
 
 &\iiY.H.HII
 
 
r4   za > 1 and a < 5r  za = 1 or a > 2 and a < 5)r1   r   r   r   rZ   r^   r  r   r   r   r   r  r  r   )r<   r*   r  r  r  r  s        @r2   r  z3ComponentReflectionTest._test_get_check_constraintsV  s3   M	3		""0u===;%HHH	
 	
 	
 	
 	IN++	++GF+CC#F++
 
 
		 	 	

 
 
 
!
 
 
	 	+<==+EFF	
 	
 	
 	
 	
r4   c                     | j         }d}d}t          |j                  }|                    ||          }|                     |           |                    ||          }|                     |           d S )Nr   r   r)   )r1   r   r   rq   r   )r<   r*   r  
view_name1
view_name2rn   v1v2s           r2   _test_get_view_definitionz1ComponentReflectionTest._test_get_view_definition~  s|    }
(
ty!!%%j%@@R%%j%@@Rr4   c                 .    |                                   d S rk   )r  r  s    r2   rr   z0ComponentReflectionTest.test_get_view_definition  s    &&(((((r4   c                 P    |                      t          j        j                   d S rd  )r  r   r   r.   r  s    r2   $test_get_view_definition_with_schemaz<ComponentReflectionTest.test_get_view_definition_with_schema  s&     	&&gn.H&IIIIIr4   
postgresqlzPG specific featurec                     | j         }t          |j                  }|                    ||          }|                     t          |t                               d S rk   )r1   r   r   get_table_oidr   r3  int)r<   r   r*   r  rn   oids         r2   _test_get_table_oidz+ComponentReflectionTest._test_get_table_oid  sQ     }ty!!  V44ZS))*****r4   c                 0    |                      d           d S )Nr   )r  r  s    r2   test_get_table_oidz*ComponentReflectionTest.test_get_table_oid  s      )))))r4   c                 R    |                      dt          j        j                   d S )Nr   r)   )r  r   r   r.   r  s    r2   test_get_table_oid_with_schemaz6ComponentReflectionTest.test_get_table_oid_with_schema  s&      1K LLLLLr4   c                     | j         }t          |j                  }dD ]D\  }}|                    |          }d |D             |         }|                    dd          sJ Ed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                      i | ]}|d          |S rN   rF   rN  s     r2   
<dictcomp>zBComponentReflectionTest.test_autoincrement_col.<locals>.<dictcomp>  s    ...A1V9a...r4   autoincrementTN)r1   r   r   rt   get)r<   r  rn   r  cnamerA  id_s          r2   test_autoincrement_colz.ComponentReflectionTest.test_autoincrement_col  s     }ty!!
 	2 	2LE5
 ##E**D.....u5C77?D111111	2 	2r4   )Nr   Nrk   )Nr   )`rA   rB   rC   run_insertsrun_deletesrD   rE   r   r3   r   r   r   r   r   r+   schema_reflectionr   r   r   provide_metadatar  r
  r  r   r   r  table_reflectionr  !foreign_key_constraint_reflectionr  r   r  r,   r  r  r   r`   r#  r%  r'  rF  ru   rP  rW  r[  rb  rf  r   ri  rl  rn  rp  ry  !primary_key_constraint_reflectionry   r|  r  r  r|   r  r   r  1foreign_key_constraint_option_reflection_ondeleter  1foreign_key_constraint_option_reflection_onupdater  r  r  r  r   r   r  r  r   r  r  indexes_with_expressionsr  r   r   r  r  r  r  r   r   r  r  r  rr   r  only_onr  r   r"  r*  rF   r4   r2   r   r      s
        $$K+K  [ N N [N
 M- M- [M-^ O O [O4 N N [N   [  'L L ('L
 '> > ('> 'N N ('N 8<$1 $1 $1 $1L &4 4 '&4
 %&%6 6 &% '& &%6
 &% % '&% &7; ; 87 '&; (" " )(" (< <  )(<
 
 
 
6 &? ?  '&? ,6 6 -,6 ,
 
  -,

 &,6 6 -, '&666 66 66 66p &! ! '&! 

 

 

 &  '& &  '&
 &
 
  '&
  &B B  '&B ++ + ,++ +,%B B &% -, ,+B
 ,2 2 -,2 ,
 
  -,

 2 2 2 2  7' ' 87' &7H H  87 '&H &	
 	
  '&	
 > > > >@ 7& & 87& 7G G  87G 08 8  108B G? ? HG? G@ @ HG@ *B *B *BX. . . = = = =* &! ! '&! &B B  '&B - - -  &*O O +* '&O &*K K +* '&K .   /.6 2, , 32, +2L L 32 ,+L +
 
 ,+
$ 2M M  32M L! L! L! L!\ 1+ + 21+ 1L L  21L %
 %
 %
 %
N     %) ) &%) %J J  &%J W_\#899+ + +  :9+* * * M M M &2 2  '&2 2 2r4   r   c                   8    e Zd ZdZdZed             Zd Zd ZdS )NormalizedNameTest)denormalized_namesTc                    t          t          dd          |t          dt          d                     t          t          dd          |t          dt          d          t          dt	          d                               d S )	Nt1Trb   r#   r$   t2t1idzt1.id)r   r   r   r   r   r/   s     r2   r3   z NormalizedNameTest.define_tables  s    D)))4d333	
 	
 	

 	D)))4d3336:g..//		
 	
 	
 	
 	
r4   c                    t          t          j                  }t          t	          dd          |d          }|j        d         }|j        j                            |j        j	                  sJ t          t          j                  }|
                    d            |j        d         j        j                            |j        d         j        j	                  sJ d S )Nr<  Tr;  )autoloadr:  c                 .    |                                  dv S )Nr:  r<  r	  )rL   ms     r2   <lambda>zINormalizedNameTest.test_reflect_lowercase_forced_tables.<locals>.<lambda>  s    

(D r4   )only)r   r   r7   r   r   r  r   r=  
referencesr#   reflect)r<   m2t2_reft1_refm3s        r2   $test_reflect_lowercase_forced_tablesz7NormalizedNameTest.test_reflect_lowercase_forced_tables  s    gj!!{4t444b4HHH4x}''44444gj!!


DD
EEEy %0041B1EFFFFFFFr4   c                 p   d t          t          j                                                  D             }t	          |d                                         |d                                                    t	          |d                                         |d                                                    d S )Nc                 >    g | ]}|                                 d v |S )rA  rB  )r   r   s     r2   r   z;NormalizedNameTest.test_get_table_names.<locals>.<listcomp>  s5     
 
 
wwyyL(( (((r4   r   r  )r   r   r7   r   r   upperr	  )r<   
tablenamess     r2   r  z'NormalizedNameTest.test_get_table_names  s    
 
WZ((88::
 
 

 	JqM!!:a=#6#6#8#8999JqM!!:a=#6#6#8#899999r4   N)	rA   rB   rC   __requires__rD   rE   r3   rL  r  rF   r4   r2   r7  r7    sX        *LK
 
 [
	G 	G 	G: : : : :r4   r7  c                   P    e Zd Zd Zd Zd Zd Zej        j	        d             Z
dS )ComputedReflectionTestc                     t          t          j                  }|                    d          }|D ]D}|d         dk    rt	          d|d         v            &|d         st          |d         d            Ed S )Ncomputed_column_tablerL   with_default42r-  r&  )r   r   r7   rt   r   r
   )r<   rn   rA  rC  s       r2   !test_computed_col_default_not_setz8ComputedReflectionTest.test_computed_col_default_not_set  s    vy!! 788 	* 	*C6{n,,I.////) *C	ND)))		* 	*r4   c                 X   t          t          j                  }|                    d          }d |D             }dD ]}t	          d||         v           |d         }t	          d|v            t	          d|d         v            t          |                     |d         d                   d           t          d|d         v t          j        j	        j
                   t          j        j	        j
        r2t          |d         d         t          j        j        j
                   d S d S )	Ncomputed_default_tablec                      i | ]}|d          |S rN   rF   rN  s     r2   r%  zKComputedReflectionTest.test_get_column_returns_computed.<locals>.<dictcomp>      +++&	1+++r4   )r#   normalrV  computedcomputed_colr  	normal+42	persisted)r   r   r7   rt   r   r   r  r   r+   "computed_columns_reflect_persistedr-   "computed_columns_default_persisted)r<   rn   rA  r&   r  compDatas         r2    test_get_column_returns_computedz7ComputedReflectionTest.test_get_column_returns_computed  s9   vy!! 899++d+++3 	1 	1CJd3i/0000'
h&'''	Xj11222DNN8J/	:;;[III8J//?G	
 	
 	
 >F 	$[1 CK    	 	r4   c                     t          d||         v            ||         d         }t          |                     |d                   |           t          j        j        j        r)t          d|v            t          |d         |           d S d S )Nr^  r  ra  )r   r   r  r   r+   rb  r-   r
   )r<   r&   columnr  ra  rd  s         r2   check_columnz#ComputedReflectionTest.check_column  s    
d6l*+++<
+DNN8I.//999>F 	2K8+,,,%y11111	2 	2r4   c                    t          t          j                  }|                    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 )NrU  c                      i | ]}|d          |S rN   rF   rN  s     r2   r%  zLComputedReflectionTest.test_get_column_returns_persisted.<locals>.<dictcomp>  r\  r4   computed_no_flagr`  computed_virtualznormal+2Fcomputed_storedz	normal-42T)r   r   r7   rt   rh  r   r+   rc  r-   computed_columns_virtualcomputed_columns_storedr<   rn   rA  r&   s       r2   !test_get_column_returns_persistedz8ComputedReflectionTest.test_get_column_returns_persisted  s    vy!! 788++d+++?G		
 	
 	
 4< 	"	   3; 	!	    	 	r4   c                    t          t          j                  }|                    dt          j                  }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 )NrU  r)   c                      i | ]}|d          |S rN   rF   rN  s     r2   r%  zXComputedReflectionTest.test_get_column_returns_persisted_with_schema.<locals>.<dictcomp>/  r\  r4   rk  z	normal/42rl  znormal/2Frm  z	normal*42T)r   r   r7   rt   r.   rh  r   r+   rc  r-   rn  ro  rp  s       r2   -test_get_column_returns_persisted_with_schemazDComputedReflectionTest.test_get_column_returns_persisted_with_schema(  s    vy!!#F,>   
 
 ,+d+++?G		
 	
 	
 4< 	"	   3; 	!	    	 	r4   N)rA   rB   rC   rX  re  rh  rq  r   r+   r,   rt  rF   r4   r2   rS  rS    sr        * * *  *2 2 2  6     r4   rS  )r   rH   r    r7  rS  ).r  r  r   rZ   r   r   r   r   r   r   r	   r
   	provisionr   r*   r   r   r   r   r~  r   r   r   r   r   r   r   r6  engine.reflectionr   r   r   sql.elementsr   r   r   r1   r   
TablesTestr    rH   r   r7  ComputedReflectionFixtureTestrS  __all__rF   r4   r2   <module>r{     s    				     $ $ $ $ $ $                                     / / / / / /                                                             " " " " " " * * * * * *             ' ' ' ' ' '             %+ + + + +8& + + +\N0 N0 N0 N0 N0X0 N0 N0 N0bX2 X2 X2 X2 X2h1 X2 X2 X2v%: %: %: %: %:, %: %: %:P_ _ _ _ _XC _ _ _Dr4   