L i ddlZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm Z ddlm Z dd lm Z dd lm Z dd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z!ddl"m#Z#ddl"m$Z$ddl"m%Z%dd l&m'Z'dd!l&m(Z(dd"lm)Z)dd#lm*Z*dd$l+m,Z,dd%l-m.Z.dd&lm/Z/dd'lm0Z0dd(lm1Z1dd)lm2Z2dd*lm3Z3d+\Z4Z5Gd,d-e jlZ7Gd.d/e7Z8Gd0d1e jlZ9Gd2d3e jtZ;Gd4d5e jtZ<Gd6d7e jlZ=d8Z>Gd9d:e0e7Z?Gd;de/e jtZAGd?d@e jlZBGdAdBe jZDGdCdDe jlZEGdEdFe jlZFdGZGy)HN)config)engines)eq_)eq_regex) expect_raises)expect_raises_message)expect_warnings)fixtures)is_)get_temp_table_name)temp_table_keyword_args)Column)Table)Boolean)DateTime)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)mockNNceZdZedZy)OneConnectionTablesTestctjjjr1ddlm}t jt|jdStjS)Nr)poolclass) poolclassscope)options) r requirementsindependent_connectionsenabled sqlalchemyr0rtesting_enginedict StaticPooldb)clsr0s n/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/test_reflection.py setup_bindz"OneConnectionTablesTest.setup_bind;sI    6 6 > > '))tgF 99 N)__name__ __module__ __qualname__ classmethodr?r@r>r.r.:s  r@r.cBeZdZdZedZedZedZedZdZ dZ e jjdZe jjd Ze jj d Ze jj$d Ze jj$e jj(e jj*d Ze jj e jjd Zy) HasTableTestTc td|tdtdtdtdtj j jrAtd|tdtdtdtdtjtj jr|j|tj jjr|j|yy) N test_tableidT primary_keydata2 test_table_sschema)rrrrrrequiresschemasr7r test_schemaview_reflection define_viewshas_temp_tabledefine_temp_tablesr=metadatas r> define_tableszHasTableTest.define_tablesMs   4d 3 66": &     # # + + tW$7vvbz*))      + +   X &    * * 2 2  " "8 , 3r@cd}tj|dt|tj|dtdtjj j rwdtjdtjd}tj|dt|tj|dtdtjzyy) Nz1CREATE VIEW vv AS SELECT id, data FROM test_table after_create before_dropz DROP VIEW vv CREATE VIEW z.vv AS SELECT id, data FROM z .test_table_szDROP VIEW %s.vv) rlistenr#rrRrSr7rrT)r=rZquerys r>rVzHasTableTest.define_viewscsC X~s5z: X}c..AB    # # + +&&&&  LL>3u: > LL%););<=  ,r@cbtttjdtjSN user_tmp_r rr<identr=s r>temp_table_namezHasTableTest.temp_table_namey%" FII6<<.9  r@c "tttj}|j}t ||t dt jdt dt jdfi|}tjjjrwtjjjrRtj|dt!dtj"ztj|dt!d yyy) NrJTrKnamerNr]=create temporary view user_tmp_v as select * from user_tmp_%sr^drop view user_tmp_v)rrr<rhrrsaINTVARCHARrrRrUr7temporary_viewsrr`r#rfr=rZkw table_nameuser_tmps r>rXzHasTableTest.define_temp_tabless $VVYY 7((*    4T 2 62::b> *        , , 4 4  0088 LL028,,?  LL=#6L2M N9 5r@ctjj5}ttjjj |dt tjjj |dt tjjj |ddddy#1swYyxYw)NrIrOnonexistent_table)rr<beginr*dialect has_tabler)selfconns r>test_has_tablezHasTableTest.test_has_tables YY__  M$ FII%%//lC D VYY&&00~F G VYY&&007JK L M M Ms BCC c"ttj}t|j dt d|t dt}t|j d|jtj t|j d|jt|j d|jtjy#|jtjwxYw)NrI new_tablecol) rrr<r*rzrrrr)create clear_cachedrop)r|rZinspnts r>test_has_table_cachez!HasTableTest.test_has_table_cachesvyy!|,- ;&*@ A ,- &))  T^^K0 1     DNN;/ 0 GGFII BGGFII s AC--!Dctjj5}ttjjj |dtj ttjjj |dtj ttjjj |dtj dddy#1swYyxYw)NrIrPrOrw)rr<rxr)ryrzrTr*r{s r>test_has_table_schemaz"HasTableTest.test_has_table_schemas YY__  $  !!++,v/A/A,   !!++.1C1C,   !!++-f6H6H,    s C C22C;ctjj5}ttjjj |dddddy#1swYyxYw)NrInonexistent_schemarP)rr<rxr)ryrzr{s r>!test_has_table_nonexistent_schemaz.HasTableTest.test_has_table_nonexistent_schemasT YY__  $  !!++,/C,    s 6AA'cNt|}t|jdyNvvrr*rzr| connectionrs r>test_has_table_viewz HasTableTest.test_has_table_viewsz"t$%r@cnt|}|j}t|j|yN)rrhr*rz)r|rrrhs r>test_has_table_temp_tablez&HasTableTest.test_has_table_temp_tables+z"..0/0r@cNt|}t|jdyN user_tmp_vrrs r>test_has_table_temp_viewz%HasTableTest.test_has_table_temp_viewsz"|,-r@clt|}t|jdtjyr)rr*rzrrTrs r>test_has_table_view_schemaz'HasTableTest.test_has_table_view_schemas'z"tV%7%789r@N)rArBrC __backend__rDr[rVrhrXr~rrrRrSrrviewsrrWrrUrqrrrEr@r>rGrGJs^K--**  OO0M  $  && $$1%1  $$ %% %%.&&%.  ::r@rGceZdZdZdZedZejdddZ dZ e d Z ejje d Zy ) HasIndexTestT)index_reflectionc td|tdtdtdtdtdtd}t d|j j tjjjrbtd|tdtdtdtdtj }t d |j j yy) NrIrJTrKrMrNdata2my_idxrPmy_idx_s) rrrrr$crMrrRrSr7rrT)r=rZtts r>r[zHasIndexTest.define_tabless    4d 3 66": & 7F2J '   h "    # # + +tW$7vvbz*)) B *bddii ( ,r@ry inspectorkindargnamescB|dk(rfdStjS)Nryc^tjjjg|i|Sr)rr<ry has_index)akr}s r>z)HasIndexTest._has_index..s&699#4#4#>#>t#Ma#M1#Mr@)rr)r|rr}s `r> _has_indexzHasIndexTest._has_indexs! 9 M M4=** *r@c |j||}|ddsJ|ddrJ|ddrJ|ddrJ|ddrJ|ddrJtd|jjjj }t d|td ttdd }|j||j| |d k(r0|ddrJ|ddrJ|jj|ddd usJ|ddd usJ |j||j|y#|j||j|wxYw) NrIrrrwnonexistent_idxmy_idx_2 test_table_2my_idx_3foorT) rr$tablesrIrrrrrr__self__rr)r|rrrZmethidxtbls r>test_has_indexzHasIndexTest.test_has_indexsotZ0L(+++ j111+X666 &7888 j111 333J 6 6 8 8 > >?   5' " *e $   : : !{" j999 ;;; ))+ j1T9 99 3t; ;; HHZ HHZ  HHZ HHZ s AE$E)c|j||}|ddtjsJ|ddtjrJ|ddtjrJ|ddtjrJy)NrIrrPrrwnonexistent_idx_s)rrrT)r|rrrs r>test_has_index_schemaz"HasIndexTest.test_has_index_schemastZ0L*V5G5GHHH hv7I7IJJJ F4F4F    -f6H6H    r@N)rArBrCr __requires__rDr[r combinationsrrrrRrSrrEr@r>rrswK(L))( 7   ; HD+  ! !:       r@rcleZdZdZdZdZejdddgeeejjdZ eeejjdZ eeejjdZy ) BizarroCharacterTestTc6tjdddddS)N) plainname)z(3))zcol%p)z[brack] columnnamerrrrEr@r> column_namesz!BizarroCharacterTest.column_names1s$##    !   r@c6tjdddddS)N)plain)z(2))z per % cent)z [brackets] tablenamerrrEr@r> table_namesz BizarroCharacterTest.table_names:s$##       r@ use_compositeFc `t||t|tddd}|r!|jtdtd|rtd|tdtdtdttd tt j dd g|j j|j jgdnGtd|tdtdtdt|j jd|j|t}td|| }|j|} |j jj| j d sJ|r5|j jj| j d sJy y )ztests for #10275rJT)keyrL test_needs_fkid2rKotherrefref2 autoload_withrN)rrr append_columnrnForeignKeyConstraintrrJrr create_allrrr referencesr) r|rrZrrrrm2o2t1s r> test_fk_refz BizarroCharacterTest.test_fk_refCsW   :wDd C      VE7E F  tW$7ug&vw'''"$$''244889LM"  tW$7uj12"   J' Z 7Bj 9 YYy !ttxx""2447+++ 4499''Q0 00 r@c t||t|ttd|j |t |}t |j|ddddy)NTrKridentitystartrrrrrrrr get_columnsr|rrrrZrs r>test_reflect_identityz*BizarroCharacterTest.test_reflect_identityrs`    :w  E J'z" D  Y ' *: 6w ?Cr@c t||tdtdt|td|j|t |}t |j |dddy)NrJTrK some commentcommentrrrrrrrrrrs r>test_reflect_commentsz*BizarroCharacterTest.test_reflect_commentssc    4d 3 :w ?  J'z" D  Y ' *9 5~Fr@N)rArBrCrrrr variationrR!foreign_key_constraint_reflectionridentity_columnsrcomment_reflectionrrEr@r>rr-sK  Wu 6^] 77)187)1V^] && D' D^] (( G) Gr@rceZdZdZdZej dZejjdZ ejjdZ y)TempTableElementsTestT)temp_table_reflectioncbtttjdtjS)N ident_tmp_rer|s r>rzTempTableElementsTest.tablenames%" FIIFLL>:  r@c t||tdttd|j |t |}t |j|ddddy)NrJTrKrrrrrr|rrrZrs r>rz+TempTableElementsTest.test_reflect_identitys^   4(*$ ? J'z" D  Y ' *: 6w ?Cr@c t||tdtdtdtd|j|t |}t |j |dddy) NrJTrKfoobarrrrrrrs r>rz+TempTableElementsTest.test_reflect_commentssa   4d 3 8Wn =  J'z" D  Y ' *9 5~Fr@N) rArBrCrrrfixturerrRrrtemp_table_comment_reflectionrrEr@r>rrsfK-L __   && D' D 33 G4 Gr@rceZdZdZdZedZdZedZee jjdZ edZ edZee jjd Zee jj"d Zee jj&d Zee jj*d Zee jj.d Zy)QuotedNameArgumentTestonceTc6td|tdttdtdtdtdtdtt j ddt j d dt jdd t jdgd gd t jd ddd tjjjrtd|tdttdtdtdtdtdtt j ddt j ddt jddt jdgd gdt jd ddd td|tdtdtdtdtjjjrtjjjrddg}ndg}|D]}dtj j"j$j'd|zdtj j"j$j'|}t)j*|dt-|t)j*|d t-d!tj j"j$j'd|zzyy)"N quote ' onerJrkrNrM related_idzpk quote ' onerkzix quote ' onez uq quote' onez related.idzfk quote ' onez name != 'foo'zck quote ' onezquote ' one commentT)rr quote " twozpk quote " twozix quote " twoz uq quote" twozfk quote " twozck quote " two zquote " two commentrelatedrKrr_view %s AS SELECT * FROM r]r^z DROP VIEW %s)rrrrrnPrimaryKeyConstraintr$UniqueConstraintrCheckConstraintrrRsymbol_names_w_double_quoter7view_column_reflectionrr<ryidentifier_preparerquoterr`r#)r=rZnamesrkras r>r[z$QuotedNameArgumentTest.define_tabless   4 ! 66": & 66": & < )  # #D/? @ HH%v .   $   # #-=    5E F.% *    7 7 ? ? tW%vvbz*vvbz*|W-''3CD)62##(''F\N1A""?9JK2"% *    4d 3 9g &      2 2 : :;;CC!! " II%%99??!D(II%%99??E  X~s5zB !& ))++??EE%,   ;r@cntjddtjjf|S)N)rr)rrrRr)fns r>quote_fixturesz%QuotedNameArgumentTest.quote_fixturess: w##  G,,HH I   r@c>ttj}tjj j r+|j|}tt|tytt5|j|dddy#1swYyxYwr) rrr<rrRreflect_table_optionsr7get_table_optionsr* isinstancer:rNotImplementedError)r|rkrress r>test_get_table_optionsz-QuotedNameArgumentTest.test_get_table_optionsspvyy!    1 1 9 9((.C JsD) *23 -&&t, - - -s 8BBcbttj}|jd|zsJy)Nr )rrr<get_view_definitionr|rkrs r>test_get_view_definitionz/QuotedNameArgumentTest.test_get_view_definition"s+vyy!'' D(8999r@c\ttj}|j|sJyr)rrr<rrs r>test_get_columnsz'QuotedNameArgumentTest.test_get_columns(s$vyy!%%%r@c\ttj}|j|sJyr)rrr<get_pk_constraintrs r>test_get_pk_constraintz-QuotedNameArgumentTest.test_get_pk_constraint-s$vyy!%%d+++r@c\ttj}|j|sJyr)rrr<get_foreign_keysrs r>test_get_foreign_keysz,QuotedNameArgumentTest.test_get_foreign_keys2s&vyy!$$T***r@c\ttj}|j|sJyr)rrr< get_indexesrs r>test_get_indexesz'QuotedNameArgumentTest.test_get_indexes8s&vyy!%%%r@c\ttj}|j|sJyr)rrr<get_unique_constraintsrs r>test_get_unique_constraintsz2QuotedNameArgumentTest.test_get_unique_constraints>s&vyy!**4000r@c\ttj}|j|sJyr)rrr<get_table_commentrs r>test_get_table_commentz-QuotedNameArgumentTest.test_get_table_commentDs&vyy!%%d+++r@c\ttj}|j|sJyr)rrr<get_check_constraintsrs r>test_get_check_constraintsz1QuotedNameArgumentTest.test_get_check_constraintsJs&vyy!))$///r@N)rArBrCrun_create_tablesrrDr[rrrrRrr r"r%rr(rr+unique_constraint_reflectionr.rr1check_constraint_reflectionr4rEr@r>rrsSKPPd -- ,,:-:&&,, 77+8+ &&&'& 22131 ((,), 11020r@rc tjddtjjfd}tjtj tj tjd}tjtjtjtjtjtjtjtjztjtjzd}tjddd}|||||S) Nc"tjSr)rrTrEr@r>rz$_multi_combination..Us F&&r@rQrr3rTF use_filter) rrrRrSr DEFAULT TEMPORARYANYrTABLEVIEWMATERIALIZED_VIEWANY_VIEW)rrQr3r filter_namess r>_multi_combinationrCQs  ! ! &    $ $  F    E   $$:??*:777 D''elKL %\"-./ 00r@c HeZdZdxZZdZedZedZedZ edZ edZ dZ d Z d Zdej ej dfd Zdej ej dfd Zdej ej dfd ZedZdej ej dfdZedZdej ej dfdZedZdej ej dfdZedZdej ej ddfdZedZdej ej dfdZedZ e!jDjFdZ$e!jDjFdZ%e!jDjFdZ&e!jDjFdZ'e!jDjFe!jDjPdZ)e!jDjFdZ*e!jDjFd Z+e!jXdd!e!jDjZfd"#e!jXde!jDj\fdd$#d%Z/e!jXde!jDj\fdd$#d&Z0e!jDjbd'Z2e!jDjfe!jDjhd(Z5e!jDjld)Z7e!jDjle!jDj\d*Z8d_d+Z9e!jXd,dde!jDj\fdde!jDjffdde!jDj\e!jDjfzfd-#d.Z:e!jDjvd/ZZOe!jDjfd?ZPe!jDjd@ZRe!jXde!jDj\fd2d$#dAZSe!jXde!jDj\fddBZTe!jdCZVe!jDjeXdDZYe!jDjleXdEZZdFZ[d`dGZ\dadHZ]eXdIZ^e!jDjeXdJZ_dKZ`e!jDjZeXdLZae!jDjeXdMZbe!jDjeXdNZce!jDjeXdOZee!jXdPe!jDjfdQdRe!jDjfdSe!jDjZfdTe!jDjfdUe!jDjfdVe!jDjfdWe!jDjlfdX# dYZfdZZge!jXddd$#e!jXde!jDjfdd[#d\Zie!jDjld]Zje!jDjd^Zly)bComponentReflectionTestNTc|j|dtjjjr+|j|tj j yyr)define_reflected_tablesrrRrSr7rrTrYs r>r[z%ComponentReflectionTest.define_tablestsF ##Hd3    # # + +  ' ''..2L2L M ,r@c |r|dz}nd}tjjjrt d|zdf}nd}t d|t dtjd t d tjd d t dtjd t dtjg|tjdddtjd|d  }t d|t dtjd t dtjt d|zddt dtjt d|zt dtjdd tjd!d"tjddd#d$|d  t d%|t dtjt d&tjt |jj t d'tjd(d )tj"dd*d+|d t d,|t d-tjd d./t dtjd(d01t d2tjd(d31t d4tjd5d61|d78t d9|t dtjd(|d:8tjj$jre|t d;|t d-tjd t dtjd(t dnt d?|t d-tjd t d@t dAt&j*j,j.zt dtjd(|d t dB|t d-tjd t dtjd(|d tjj0jrt3dC|jj4|jj6d t3dD|jj |jj6|jj4|st dE|t dFtjd d G}t dH|t d-tjd t dFtjd d G}tjj8jrtjj:jr\t3dI|jj<j?t3dJ|jj<j?tjj@jr|jC|||s7tjjDjr|jG|yyy)KN.z%susers.user_id user_id_fkrrEusersuser_idTrKtest1Fnullabletest2parent_user_id test2 > 0zz_test2_gt_zerousers check constraintrkr test2 <= 1000rQr dingalings dingaling_id address_idz%semail_addresses.address_idzz_email_add_id_fg di fk commentid_userrM)uniquez$address_id > 0 AND address_id < 1000address_id_gt_zerozz_dingalings_multipledi unique commentemail_addressesremote_user_id email_address)index email_ad_pk ea pk comment comment_testrJ id comment)rLrdata % commentrd2)Comment types type speedily ' " \ '' Fun!d3*Comment with escapesthe test % ' " \ table comment)rQrno_constraints"no constraints has escaped comment local_table remote_idz%s.remote_table_2.id)rrQ remote_tablelocal_idz%s.local_table.idremote_table_2 users_t_idx users_all_idxnoncol_idx_test_nopkqrnoncol_idx_test_pknoncol_idx_nopk noncol_idx_pk)$rrRself_referential_foreign_keysr7rrrrnroCHARFloatrr rr rrMr cross_schema_fk_reflectionrrTr<rydefault_schema_namerr$rNrRindexes_with_ascdescreflect_indexes_with_ascdescrdescrrVrrX)r=rZrQ schema_prefixparent_id_argsrLr~rs r>rGz/ComponentReflectionTest.define_reflected_tableszs4 "SLMM    9 9 A A% 5LN  N   9bff$ 7 7BGGAJ 7 7BHHJ 7 #RZZ A. A   '0     / "    >2::4 @  2]B-+   ,}<=  6299R= 6   6)    -+   = @    < , #RZZEGGOO1L M ?BIIbM >  # #=/      4| L 6299R=2B C  " H  420H I9     6299R= )<      6 6 > >~!4>6299R=1#"2W^^5O5OO #'!99,,@@ "4>""/$ii//CCD6299R=1!"&$4>6299R=1!"&     , , 4 4 - d K %''-- ',*3 ! -"& ($&+(4>3 ! -"& &"$$99AA((EEMM+-A-C-C-E-E-J-J-LM/+=+?+?+A+A+F+F+HI    2 2 : :   Xv .'**@@HH  " "8 ,Ivr@cbtttjdtjSrcrergs r>rhz'ComponentReflectionTest.temp_table_name(rir@c tttj}|j}t ||t dt jdt dt jdt dt jt jddtjt jd dfi|}tjjjrwtjj jrRt#j$|d t'd tjzt#j$|d t'd yyy)NrJTrKrkrNr user_tmp_uq_r user_tmp_ixr]rlr^rm)rrr<rhrrrnrorpr rfr$rrRrUr7rqrr`r#rrs r>rXz*ComponentReflectionTest.define_temp_tables.s $VVYY 7((*    4T 2 62::b> * 5"&& !   |FLL>-J K HH]E *  "    , , 4 4  0088 LL028,,?  LL=#6L2M N9 5r@c tjjjrdh}n t }dD]}|}|r|d|}|dz}||vrdnd}d|d|d |}t j |d t|||vrId } |rtjd r|d| } d | d|d} t j |d t| t j |dtd|d|y)NrZrLrerZrI_vz MATERIALIZED rJzCREATE zVIEW r r] mat_indexoraclez CREATE INDEX z ON z(data)r^zDROP ) rrRmaterialized_viewsr7setrr`r#against) r=rZrQ materializedrtfullname view_nameprefixra index_namers r>rVz$ComponentReflectionTest.define_viewsPs     . . 6 6(>L5LD J!H$XQzl3 4I(2l(B_F&yk1CH:N  LL>3u: >\)( gooh7$*81ZL!9J%j\i[G X~s3x@ LL-uVHE)-M)N # r@ci}tj|vr|j|tj|vr|j|tj|vr|j||Sr)rr>updater?r@)r|rrrrrs r> _resolve_kindz%ComponentReflectionTest._resolve_kindksX   t # JJv  ??d " JJu   ' '4 / JJ| $ r@ctjjjs!|j |j ytjj js"|j ||j yyr)rrRrr7clearrr)r|rrs r>_resolve_viewsz&ComponentReflectionTest._resolve_viewsus^66>>    KKM!!44<< LL &    =r@c d}|tjurd}|tjurd}dddhtjj dddd |j hi}tjjjsB|djd|tjj jddgtjjjs|djddgtjjjr$tjjjs$|djd |j gtjjjs|djd g|j!Dcic]#\}}||r|d ||vr |r|d |vr||%} }}| Scc}}w) Ncy)NTrE)_s r>rz8ComponentReflectionTest._resolve_names..~sr@cd|dvSNtmprrErs r>rz8ComponentReflectionTest._resolve_names..sU!A$%6r@cd|dvSrrErs r>rz8ComponentReflectionTest._resolve_names..sUad]r@ryr{rwr~rrr)r r;r<rrrTrhrRrr7addrrrtemp_table_namesrqitems) r|rQr3rBvalues scope_filterremovedrvrs r>_resolve_namesz&ComponentReflectionTest._resolve_names}s% K'' '6L K)) )2L >#34 NN & &&$$$& )  ::BB DM  m , GNN.. / 6 6!12 0088 DM ')=>   66>>##44<< DM ,0D0D0F!G H//77 DM , 0  1A!GFO+!QqT\%9 qD    s9(G&c|dftji}|dftj|dftj|dftji}|j|||dftj|dftj|dftj|dftj|d ftj|d ftj|d ftj|d ftj|d ftj|dftj||jftji }|j ||||}|j ||||}|S)N dingalings_vemail_addresses_vusers_vrrLrZrerlrurwryr{r~rr+r=rrhrr) r|rQr3rrBrrrrs r> exp_optionsz#ComponentReflectionTest.exp_optionss= 0$((; ( )488 Y  \ "DHH  E<0 W txx \ "DHH & ' ^ $dhh % & ] #TXX ^ $dhh % & + ,dhh ) *DHH T))+ ,dhh    vulC!!&%sC r@c*ddi}|df|i}|df||df||df|i}|j|||df||df||df||d fdd i|d fdd i|d f||df||df||df||df|||jf|i }|j||||} |j|||| } | S)NtextrrrrrLrZrerlrtrurvrwryr{r~r)rrhrr) r|rQr3rrBemptyrrrrs r> exp_commentsz$ComponentReflectionTest.exp_commentss 0%8 ( )5 Y  \ "E  E<0 W u \ "E & ' ^ $='% &@)] #U ^ $e % & + ,e ) *E T))+ ,e "  vulC!!&%sC r@c dtjddfd fd}|df ddtj d  d  d gi}|d f d dtj d  dg|df ddtj dtj dtj dg|df ddtj d dgi}|j|||df|d dd dd dg|df|d d  d  d g|df|d  d  dg|df|dd 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||jf|d d dgi }|j ||||} |j |||| } | S)-NFTc`||tj|||d}|dk(r|jd|S)N)rk autoincrementtypedefaultrrQomitr)r+r=pop)rkautorrrQrs r>rz0ComponentReflectionTest.exp_columns..cols;!%""$ Cv~(Jr@cBdtjdd|}|fi|S)NTF)rrrQr+r=)rkrsrs r>pkz/ComponentReflectionTest.exp_columns..pks&488M"MBt?r? "r@rr[r)rrQr\r_rMrrfrgrrMrNrPrRrSrrJrkrrLrZrerlrmrrnrorprqrsrurwrxryrzr{r~rrr) r|rQr3rrBrrrrrrs @r> exp_columnsz#ComponentReflectionTest.exp_columnssdhht  # ^ $N$((CL!IF ' ( )LvA$%O$, Y IFTXX>Gdhh/Gdhh/$% " \ "Dv9F E % $ E<0 W 9 Ge,Ge,$%   \ ">"L!IF % & '< $%O$* ^ $4.F$45LD":;'% &V ] #bhF S=M%N ^ $r$xZ#f+&N % &D3v;(? + ,s3xj ) *RXs3x,@ T))+ ,4F E /C& N  vulC!!&%sC r@c hdS)N>rkrrrQrErs r>_required_column_keysz-ComponentReflectionTest._required_column_keysKs66r@ctjddd}|d}tjjj r |df|di}n|df|i}|df||df||df|i}|j |||d f|d |d f|d|d f|d dd|df|d|df||df|d|df|d|df|d|df||df|d||jf|di } tjjj s.| jD]} | d tj| d<|j|| ||} |j|||| } | S)NrWc t|||dS)N)constrained_columnsrkr)list)rkrcolss r>rz+ComponentReflectionTest.exp_pks..pkVs'+Dz" r@rrr[rrrrLrMrZrer\rjrkrlrJrurwryr{r~rrk) r+r=rrRmaterialized_views_reflect_pkr7rrhreflects_pk_namesrrr) r|rQr3rrBrrrrrvalrs r>exp_pkszComponentReflectionTest.exp_pksOs 88T      9 9 A A#^4b6HIL#^4e_required_pk_keysz)ComponentReflectionTest._required_pk_keyss-..r@cT Gdd |tjdf fd }|dfgi}|dfg|dfg|dfgi}|j|||df|d gd gdd g|d f|dgd gd|dgdgdddg|df|dgd gdg|dfg|dfg|df|dgdgdtjg|df|dgdgddg|dfg|dfg|dfg||j fgi }t jjjs||dfjt jjjsE|jD]2} | D]+} | d tjustj| d <-4|j||||} |j|||| } | S)!NceZdZdZy)+ComponentReflectionTest.exp_fks..ttc\|duxs'tjjj|k(Sr)rr<ryr)r|rs r>__eq__z2ComponentReflectionTest.exp_fks..tt.__eq__s,TMFyy((<<Er@NrArBrCrrEr@r>rrs r@rcF|||tj||n||dS)N)rreferred_columnsrkr4referred_schemareferred_tablerr)rref_col ref_table ref_schemarkrrs r>fkz+ComponentReflectionTest.exp_fks..fks1(,$+88","8Jbd"+"  r@rrrrrLrSrMrKrrZr_r\rer]r^rWrfrlrurwrxrJr{)rryrzr~rrk)r+r=rrrTrhrrRrr7rnamed_constraintsrrr) r|rQr3rrBrrrrvalsrrrs @r>exp_fkszComponentReflectionTest.exp_fkss?    ( 0"5 ( )2 Y  \ "B  E<0 W $% {G,O \ "I; W5!N!N%-+  %& '$% {G<*^ $b % & ] # MF$%11 &^ $J<$4H'% & + ,b ) *B T))+ ,bC" F==EE FG$ % + + -1199  //C6{$((2&*hhF / /   vulC!!&%sC r@c hdS)N>rkrrrrrErs r>_required_fk_keysz)ComponentReflectionTest._required_fk_keyss   r@c^dddddd}|dfgi}|dfg|dfg|dfgi}|j|||r||dfj|dd |d fg|d d d|dddd |dddd|dfg|dtjdd|dtjd|ddddd|dfg|dtj |dtjd|dfg|d fg|d!fg|d"tjd|d#fg|d$tjd|d%fg|d&fg|d'd(d'd)i*|d+fg|d'd,d'd)i*||j fg|d-d. |d/d0t j dd1i }tjjjr$tjjjs*||d&fj||d+fj|j||||} |j|||| } | S)2NF)racolumn_sorting duplicatesrctjj}tjj}tjj}|r |j r|r |j sy|t ||tjgd} |r4|| d<|j r#| dx| d<} | D cgc] } | |vrdn|  c} | d<|r|| d<| gScc} w)NrE)rarrkdialect_optionsinclude_columnsrr expressionsduplicates_constraint) rrRforeign_keys_reflect_as_index#unique_constraints_reflect_as_index*reflect_indexes_with_ascdesc_as_expressionr7rr+r=) rkrarrrrfk_reqdup_reqsorting_expressionrorigrs r>rz0ComponentReflectionTest.exp_indexes..idxs%%CCF&&JJG  KK 6>>7?? $T #'88#% C(6$%%--03N0CCC &DH+?@^ 3:+C'/3+,5L +s,C rrrrrMrrrLrSrKT)rkrrMrRrNr}r|)rkrarZ)rkrarr_r\r[rcrergrfrlrurwrxryrzr{r~rr)r)rkrrrrrrkr)rkrra)rextendr+r=rhrrfrrRrr7rrrr) r|rQr3rrBrrrrrs r> exp_indexesz#ComponentReflectionTest.exp_indexess # J 0"5 ( )2 Y  \ "B  E<0  &.1 2 9 9F- W  %LTB YG WgM$G  \ " %V$((4DI %YTXX$7 % "1#  %& '*_4884*%DHH>*^ $b % & ] #&[txxD9&^ $'Zdhh48'% & + ,/*$'#3/) *-osI>N- T))+ ,/U//' ~6# /U3 j  55==##@@HH F23 4 : : < F01 2 8 8 :  vulC!!&%sC r@c hdS)N>rkrarrErs r>_required_index_keysz,ComponentReflectionTest._required_index_keysZs11r@Fcddddd}|dfgi}|dfg|dfg|dfgi}|j|||dfg|d d d d d |dfg|dtjtj|ddddd|dfg|dfg|dfg|dfg|dfg|dfg|dfg|dfg||jfg|ddtj  i } |ri||| S|j || ||} |j|||| } | S)!NF)duplicates_indexis_indexrctjj}|r |jsyt |||d}|r||d<|gS)NrE)rrkrr)rrR*unique_index_reflect_as_unique_constraintsr7r)rkrrrrreqrs r>ucz+ComponentReflectionTest.exp_ucs..ucfsL""MMC  $T "C  *:&'5Lr@rrrrrLrNrRr|T)rkrrrZrM)rkrr\r[rcrd)rkrrrerlrurwryr{r~rrkrr)rr+r=rhrrfrr) r|rQr3rrBall_rrrrrs r>exp_ucszComponentReflectionTest.exp_ucs^s+/  0"5 ( )2 Y  \ "B  E<0 W  &%2!  \ " %FDHHE % "1%=/  %& ' ^ $b % & ] #R ^ $b % & + ,b ) *B T))+ ,/F< ~!>?/9 @ 6l6e6v6 6$$T65,GC%%fe\3GCJr@c ddhS)NrkrrErs r>_required_unique_cst_keysz1ComponentReflectionTest._required_unique_cst_keyss ''r@c Gddt d fd }|dfgi}|dfg|dfg|dfgi}|j|||df|d tj|d d d g|df|ddg|dfg|dfg|dfg|dfg|dfg|dfg|dfg|dfg||j fgi }|j ||||} |j |||| } | S)NceZdZdZy)+ComponentReflectionTest.exp_ccs..ttc|jjddjddjdd}||vS)N(rJ)`)lowerreplace)r|rrs r>rz2ComponentReflectionTest.exp_ccs..tt.__eq__s@KKMWS"%WS"%WS"%  s{"r@NrrEr@r>rr s #r@rc|||dS)N)sqltextrkrrE)rrkrrs r>ccz+ComponentReflectionTest.exp_ccs..ccs!$x'J Jr@rrrrrLrXrTrUrVrrZz$address_id > 0 and address_id < 1000rbrrerlrurwryr{r~rr)strrr+r=rhrr) r|rQr3rrBrrrrrrs @r>exp_ccszComponentReflectionTest.exp_ccssK # # K  0"5 ( )2 Y  \ "B  E<0 W ?DHH-&4 \ ":-% & ' ^ $b % & ] #R ^ $b % & + ,b ) *B T))+ ,b/ 2  vulC!!&%sC r@c ddhS)NrkrrErs r>_required_cc_keysz)ComponentReflectionTest._required_cc_keyss  ""r@ct|}ttjj|j vyr)rr*rrrTget_schema_namesrs r>test_get_schema_namesz-ComponentReflectionTest.test_get_schema_namess,z"**d.C.C.EEFr@ct|}t|jtjj t |jdy)Nsa_fake_schema_foo)rr* has_schemarrrTr)rs r>test_has_schemaz'ComponentReflectionTest.test_has_schemas9z" : :;<!567r@c|jddttjji}t |}t tjj|jvy)z test #7300rbarschema_translate_mapN)execution_optionsr&rrrTrr*rrs r>%test_get_schema_names_w_translate_mapz=ComponentReflectionTest.test_get_schema_names_w_translate_maps^ 11ugnn88"2 z"**d.C.C.EEFr@c|jddttjji}t |}t |jtjjt|jdy)Nrr r!r) r#r&rrrTrr*rr)rs r>test_has_schema_w_translate_mapz7ComponentReflectionTest.test_has_schema_w_translate_mapsi11ugnn88"2 z" : :;<!567r@c t|}td|jvt|jd|j t d td|jvt|jd|j td|jvt|jd|j t dy#|j t dwxYw)Nfoo_barzCREATE SCHEMA foo_barzDROP SCHEMA foo_bar)rr)rrexecuter#rr*rs r>test_schema_cachez)ComponentReflectionTest.test_schema_cache sz"d33556+,3678 ; Y$"7"7"99 : T__Y/ 0     I!6!6!88 9 DOOI. /   s#89 :J  s#89 :s A:C11D crtj}t|t|jdsJy)Nr)rr9rhasattrry)r|engines r>test_dialect_initializez/ComponentReflectionTest.test_dialect_initializes,'')v~~'<===r@cnt|}t|j|jjyr)rrrryrs r>test_get_default_schema_namez4ComponentReflectionTest.test_get_default_schema_name$s(z" D $ $j&8&8&L&LMr@ foreign_keyorder_byr use_schemacZ|rtj}nd}hd}t|}|r'|j|Dcgc] }|dr|d}}n|j |}|D cgc] } | |vs|  } } |dk(rgd} t | | ygd} t t | | ycc}wcc} w)N>rwrlryrur{rr~rr1r)rZrerL)rrTrget_sorted_table_and_fkc_namesget_table_namesrsorted) r|rr2r3rQ_ignore_tablesrrecrtranswers r>test_get_table_namesz,ComponentReflectionTest.test_get_table_names)s ''FF z"  >>vFq6AF ))&1F"(DQA^,CqD D } $?F  V $?F {#V ,EsB## B(-B(cHt|}|rtj}nd}|j|}tj j jr4tt|ddgt|j|dgygd}tt||y)Nrrr)rrr) rrrTget_view_namesrrRrr7rr7get_materialized_view_names)r|rr3rrQrr;s r>test_get_view_namesz+ComponentReflectionTest.test_get_view_namesTsz" ''FF))&1    . . 6 6 {#&99%E F 008>:J KEF {#V ,r@ct|}|j}tt|dtj gyrc)rget_temp_table_namesrr7rrfr|rrrs r>test_get_temp_table_namesz1ComponentReflectionTest.test_get_temp_table_nameses9z"446 F# $6<<.'A&BCr@cft|}|j}tt|dgyr)rget_temp_view_namesrr7rCs r>test_get_temp_view_namesz0ComponentReflectionTest.test_get_temp_view_namesks/z"335 F# $|n5r@c&|j|yr)_test_get_commentsr|rs r>test_get_commentsz)ComponentReflectionTest.test_get_commentsrs  +r@cX|j|tjjyr)rIrrrTrJs r>test_get_comments_with_schemaz5ComponentReflectionTest.test_get_comments_with_schemavs  GNN,F,FGr@ct|}|j|}t|jd|||dft|jd|||dft|jd|||df|jj j }t|j|||||fy)NrPrlrL)rrrr0rrurk)r|rrQrexpno_csts r>rIz*ComponentReflectionTest._test_get_comments{sz"v.  " ">& " A ( )  " "76 " : ! "  " ">& " A ( ) ++00  " "6& " 9  ! r@)FFzuse_views,use_schemac|rtj}nd}|jj|jj}}|rgd}nddg}t |}t |||fD]\} } |} |j| | } tt| dkDt| t| jD]\} }t|j| | d| | dj}|j}t!|t"j$j&r |j}t)j*dr2|t,j.t,j0fvrt,j.}ttt3|j4j7|j4j7t,j8t,j:t,j0t,j.t,j<t,j>t,j@gdkD|jd |jd | | dd |d |jBr| | d J y) NrrrrLrerPrrkrrr z), r r)"rrTrrLrerziprr*len enumeratecolumnsrrk __class__rrrnr TypeEnginerr sql_typesDaterr__mro__ intersectionrNumericTimer_BinaryrL)r|r use_viewsr3rQrL addressesrrrttable schema_namerirctype ctype_defs r>r"z(ComponentReflectionTest.test_get_columnss ''FF KK--t{{/J/Jy JK"$56Kz"!$[5)2D!E/ 6 J K##J{#CD CIM3t9 -$EMM2( 63CHHd1gfo.Q11HH i)<)<= ) 3 3I??8,NN&&?2!*I EMM*%i&7&78% ) 1 1 ) 1 1 ) 2 2 ) ) ) 0 0 ) 1 1 "xx476?EC#*79-555Q( 6/ 6r@c|j}|j|}t|t|}|j ||dy)NrF)strict_constraints)rhrrrassert_tables_equal)r|rrtrureflected_user_tmps r>test_reflect_table_temp_tablez5ComponentReflectionTest.test_reflect_table_temp_tablesO))+ ;;z*"  *    (U ! r@c.|j}|j|}t|}|j|}t t |dkDt |t |jD]!\}}t|j||d#y)Nrrk) rhrrrr*rTrUrVrrk)r|rrtrurrrdrs r>test_get_temp_table_columnsz3ComponentReflectionTest.test_get_temp_table_columnss))+ ;;z*z" +D A s4y) 0 01 +FAs $q'&/ * +r@ct|}|jd}t|Dcgc]}|d c}gdycc}w)Nrrk)rJrkr)rrr)r|rrrrs r>test_get_temp_view_columnsz2ComponentReflectionTest.test_get_temp_view_columnss;z" - D )SS[ )+@A )s =)Fc,|rtjj}nd}|jj|jj }}t |}|j|}|j|j|}|j|g|||jfg|j|j|j|} |||jfd} t| d| tjjj5t| ddddd|jj j} |j|j| |g||| fg|jy#1swY_xYw)NrPrrkrj)rrrTrrLrerrr$rk _check_listrrrRrfail_ifru) r|rr3rQrLrarrO users_cons addr_consexp_colsrPs r>r%z.ComponentReflectionTest.test_get_pk_constraintsm ^^//FF;;,,dkk.I.Iyz"ll&l)++EJJv+F   L3 345t7M7M **9>>&*I  /01FG I+ ,h7    / / 7 7 9 2  &!= 1 2++00   # #F6 # : ; &&! " #  " "  2 2s F  Fc>|rtj}nd}|jj|jj}}t |}|}t jjjr|j|j|}|d} t jjj5t| dddddt| d|t| d|jt| ddgt| d d g|j|j|} | d} t jjj5t!| ddudddt| d|t| d|jt| ddgt| d d g|jj"j} t|j| |gy#1swY;xYw#1swYxYw) NrPrrkrKrrrrMrrSrf)rrTrrLrerrrRrr7r'rkrrrrimplicitly_named_constraintsr*ru) r|rr3rQrLrarexpected_schema users_fkeysfkey1 addr_fkeysrPs r>r(z-ComponentReflectionTest.test_get_foreign_keyss ''FF KK--t{{/J/Jyz"     9 9 A A// 6/JKNE!!33;;= 1E&M<0 1 '(/ : &' 4 ()I; 7 +,/?.@ A**9>>&*I 1     : : B B D / E&M- . / E# $o6 E" #UZZ0 E$ % {3 E' (+;*<=++00 D ! !& ! 8"=+ 1 1 / /s=H'HHHch|jd|jjzdtjj zdtjj z\}}}t |}|j|j}tt|d|d}t|dtjj t|d|jt|dd gt|d d g|j|jtjj }tt|d|d} t| dd|jjfvt| d|jt| dd gt| d d gy)Nz%s.local_tablez%s.remote_tablez%s.remote_table_2rrrrrrJrrxrPrz) rryrrrrTrr'rkrrTr*) r|rrwryr{r local_fkeysrz remote_fkeysfkey2s r>"test_get_inter_schema_foreign_keysz:ComponentReflectionTest.test_get_inter_schema_foreign_keysIs59KK z11EE E  : : : '.."<"< <5 1 \> z"++K,<,<=  C a A E# $gnn&@&@A E" #^%8%89 E$ %v. E' (;-8,,   gnn&@&@-  C q!Q # $""66   E" #[%5%56 E$ %v. E' (:,7r@cx|rtj}nd}t|}|jd|}|j |}|j |||df|j |jjj}|j |j|||||f|j y)NrLrP) rrTrr*rrqrrrurk)r|rr3rQrindexesrOrPs r>r+z(ComponentReflectionTest.test_get_indexesos ''FFz"""76":f-  S&'*+T-F-F ++00    VF  3  !  % % r@)r~r)rrz tname,ixnamect|}|j|}|jd|f}|j|||jt |t |}tt|jdtt|jdj|tt|jdj|y)Nrrr)rr*rrqrrrrrTrr rrbrk)r|rtnameixnamerrexpected_indexesr:s r>test_get_noncol_indexz-ComponentReflectionTest.test_get_noncol_indexsz"""5) ++-tUm< "2D4M4MN %: > C NA DOA  $ $a( DOA  # #V,r@ct|}|j}|j|}|jdd|f}|j |||j y)NT)r)rrhr-rrqr)r|rrrk reflectedrOs r>&test_get_temp_table_unique_constraintsz>ComponentReflectionTest.test_get_temp_table_unique_constraintss]z"##%//5 lll%tTl3 C)B)BCr@cFt|}|j}|j|}|D]}|jddddgddg}tj j jrg|dd<t|Dcgc] }|ddk(s |c}|ycc}w) NrFrr)rarrkrrrk) rrhr*rrrRindex_reflects_included_columnsr7r)r|rrrtrindexpectedrs r>test_get_temp_table_indexesz3ComponentReflectionTest.test_get_temp_table_indexessz"))+ "":. -C GG%t , -ug} M     ; ; C C-/HQK) * # DSs6{m'CS D  Ds  BBc,|rtj}nd}tddgddgdddgdddd d gdd d gdd dgdgtjd}t d|t dtjdt d tjdt dtjt d tjdt d tjd|}|D],}|jtj|dd|di.|j|t|}t|jd|tjd} t} t!t#|t#| t%|| D]d\} } | j'dd} | r| j)| t!| j'ddd| j'ddt!| | ft+}t d|||} | j,Dchc]}|j.}}| j0Dchc](}t3|tjr |j.*c}j5dg}|j7|rJ| r t!| |t!|t|j8j:j.}t!|j||gycc}wcc}w)Nunique_ar)rkr unique_a_b_c)rbr unique_c_a_b)rrrunique_asc_keyascrz i.have.dotsrz i have spacesrrkrtesttblrhr`rPrrrr)rrQ)rrTr7operator itemgetterrrrnrrappend_constraintr rrr-rrrTrSrrrrrk constraintsr differencer\rru)r|rZrr3rQuniquesrbrrrnames_that_duplicate_indexrrefldupereflected_metadatar idx_namesuquq_namesrPs r>r.z3ComponentReflectionTest.test_get_unique_constraintss ''FF#cU;'I'I)E5>J&>(3%@  ##F+     3 " & 3 " & 3 # 5"))B- ( 5"))B- (   B  # ###R%7IbjI    Z z"  ' ' & ' A##F+ &)U" CL#i.)gy1 JD$88.5D*..t4 D)4 0 HH& - dO &Z  $  *3):):;#SXX; ; ++ "b112 GG  *n% &  ))(333 % *I 6 #% ++00 D ' 'v ' >C< s 6L -Lc|rtj}nd}t|}dD])}|j||}t t |+y)NrRrP)rrTrrr*bool)r|rr3rQrviewrs r>r z0ComponentReflectionTest.test_get_view_definitionsQ ''FFz"D D((f(=A DG  r@ct|}tt5|jddddtt5|jddddy#1swY3xYw#1swYyxYw)Nview_does_not_existrL)rrr!rrs r>'test_get_view_definition_does_not_existz?ComponentReflectionTest.test_get_view_definition_does_not_exist#sjz" + , <  $ $%: ; < + , .  $ $W - . . < < . .sAA+A(+A4ct|}dD]A\}}|j|}|Dcic]}|d| c}|}|jddrAJycc}w)atest 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. ))rLrM)rer\)rZr[rkrTN)rrget)r|rrrcnamerrid_s r>test_autoincrement_colz.ComponentReflectionTest.test_autoincrement_col+skz"  2LE5 ##E*D)-.A1V9a<.u5C77?D1 11 2 /s Acttj}|rtjnd}tj j jrY|jd|}tt|t|jd|}tt|tytt5|jd|dddy#1swYyxYw)NrLrPru)rrr<rTrrRrr7rr*rr:rr)r|r3rrQrs r>rz.ComponentReflectionTest.test_get_table_optionsDsvyy!'1##t    1 1 9 9(((@C JsD) *(()9&(IC JsD) *23 ?&&wv&> ? ? ?s :CC cttj}tjj j rf|rtjnd}|j|}|j|Dcic]}||f|j||}}t||ytt5|jdddycc}w#1swYyxYw)NrP)rrr<rrRrr7rTget_multi_table_optionsr6rrrr)r|r3rrQrrbrOs r>test_multi_get_table_optionsz4ComponentReflectionTest.test_multi_get_table_optionsUsvyy!    1 1 9 9+5V''4F..f.=C"111@!7!7f!7!MMC SM23 /,,. / /   / /s8C 3CCcfd}|S)Nct }||d||d}|r|}g}tj|vr|jgdtj|vr|jddgtj |vr|jddg|r||d<|r||d<|||||j d } |g} |tjk(r2|j} | jd | j| |tjk(r2|j} | jd | j| t | | fS) Nre)r3r)rlrLdoes-not-existrrrrQrB)rQr3rrBr3r) rrr>rr?r@rr r;copyrappend) rQr3rr:single_reflect_fn exp_methodrrsrBrOkwsnkwrs r>provide_fixturez>ComponentReflectionTest.get_multi_exp..provide_fixturegsK:&D d$5 6 $/BL4'##?$&##%8:J$KL++t3##^5E$FG%8 %1>"VVN3 C $C +++ggi  3z'''ggi 3:&S0 0r@rE)r|rrs ` r> get_multi_expz%ComponentReflectionTest.get_multi_expes, 1\r@c|||||tj|j\}}}|D]0} |j|jdi| } t | |2yNrE)rrrrrr r|rrQr3rr:rrrOrsresults r>#test_multi_get_table_options_tablesz;ComponentReflectionTest.test_multi_get_table_options_tablessn '      ' '     c3 B    1T117B7F   r@c|||||tj|j\}}}|D].} |jt |j di| |0yr)rr0rrrget_multi_table_comment) r|rrQr3rr:rrrOrss r>test_get_multi_table_commentz4ComponentReflectionTest.test_get_multi_table_commentsj '      ' '     c3 9B     ,,,2r2C 8 9r@c dtfd}t|tr6t|j Dcic]\}}|||c}}||yt|Dcgc] }|| c}||ycc}}wcc}w)NrcLtjdd|jS)Nz['\" ]rJ)resubr)rs r>_cleanz:ComponentReflectionTest._check_expressions.._cleans66)R.446 6r@)rrr:rr)r|rrOerr_msgrers r>_check_expressionsz*ComponentReflectionTest._check_expressionssf 7 7 c4 &,,.9$!QA93 H F+q+S' ::+s A3 A9cT|t|||ytt|t||t||D]j\}}t|t|zD]K}||vs ||vs ||vs|d|d|}|dvr|j |||||9t|||||Mly)Nz - )rr)rrTrSrr) r|rrOreq_keysmsgrrrrs r>rqz#ComponentReflectionTest._check_lists   S ! F SXs +FC( 51Q#a&5AH}aAF%(EQCs1#"6 AA 33AaD!A$H!adG4 5 5r@ctt|jt|j|D](}||||}}|r|g|g}}|j||||*yr)rrkeysrq)r|rrOr make_listsrrrs r>_check_table_dictz)ComponentReflectionTest._check_table_dictse C CHHJ0 0A!9c!fqAsQC1   Q8Q /  0r@c|||||tj|j\}}}|D]A} |j|jdi| } |j | ||j Cyr)rrrrget_multi_columnsrrrs r>test_get_multi_columnsz.ComponentReflectionTest.test_get_multi_columnss~'      ! !     c3 LB    +T++1b1F  " "630J0J K Lr@c|||||tj|j\}}}|D]C} |j|jdi| } |j | ||j dEy)NT)rrE)rr$rrget_multi_pk_constraintrrrs r>test_get_multi_pk_constraintz4ComponentReflectionTest.test_get_multi_pk_constraints '      ' ' LL  c3 B    1T117B7F  " "T33 #  r@ctjjjsS||fD]K}|j D]6}t |dkDst d|Ds%|j|8Myy)Nrc3bK|]'}|jddtjfv)yw)rkN)rr+r=).0rs r> z7ComponentReflectionTest._adjust_sort.. s+,>?f $)99,s-/r)rrRrwr7rrTanysort)r|rrrobjrs r> _adjust_sortz$ComponentReflectionTest._adjust_sortsu<<DD) *::<*C3x!|,CF,)S) * *Er@c |||||tj|j\}}}|D]U} |j|jdi| } |j | |d|j | ||jWy)Nct|dS)Nrtupleds r>rzEComponentReflectionTest.test_get_multi_foreign_keys.. suQ/D-E'Fr@rE)rr'rrget_multi_foreign_keysrrrrs r>test_get_multi_foreign_keysz3ComponentReflectionTest.test_get_multi_foreign_keys s '      & & LL  c3 HB    0T00626F   F   " "630F0F G  Hr@c|||||tj|j\}}}|D]A} |j|jdi| } |j | ||j Cyr)rr*rrget_multi_indexesrrrs r>test_get_multi_indexesz.ComponentReflectionTest.test_get_multi_indexes s~ '      ! !     c3 KB    +T++1b1F  " "630I0I J Kr@c |||||tj|j\}}}|D]U} |j|jdi| } |j | |d|j | ||jWy)Nct|dS)Nrrrs r>rzKComponentReflectionTest.test_get_multi_unique_constraints..? sU1^;L5Mr@rE)rr-rrget_multi_unique_constraintsrrrrs r>!test_get_multi_unique_constraintsz9ComponentReflectionTest.test_get_multi_unique_constraints/ s '      , , LL  c3 PB    6T66<rzJComponentReflectionTest.test_get_multi_check_constraints..R sU1Y<5Hr@rE)rr3rrget_multi_check_constraintsrrrrs r> test_get_multi_check_constraintsz8ComponentReflectionTest.test_get_multi_check_constraintsB s '      + + LL  c3 HB    5T55;;F   fc+H I  " "630F0F G  Hr@rrr$r'r*r-r3r0methodct|}t||}tt5|ddddy#1swYyxYw)Ntable_does_not_exists)rgetattrrr!)r|rrrrs r>test_not_existing_tablez/ComponentReflectionTest.test_not_existing_tableU sA0z"tV$ + , * ( ) * * *s 9Ac Htjfd}tjj td|5t t d5t|jtdtdddddddy#1swYxYw#1swYyxYw)NcT|jdi}td|d<|i|S)N unreflectableerr)N some_table) setdefaultr")rrurmcs r>patchedz;ComponentReflectionTest.test_unreflectable..patchedu s1or2B'>u'EB# $q;A; r@rrr) rrr+patchobjectr r"r reflect_tablerr)r|rrrs @r>test_unreflectablez*ComponentReflectionTest.test_unreflectabler s  ( (  ZZ  y*=w G &'>F  #11, 3T       s#B .B ;B B BB!rct}|rtjnd}|j|||dt |}|j |}|r)||j |z } ||j|z }|r|Dcgc] }|d| }}tt|jt|y#t$rYJwxYwcc}w)NF)rQr resolve_fksrI) rrrTreflectrr6r>r?rrr7r) r|rr3rmrQrrr:s r> test_metadataz%ComponentReflectionTest.test_metadata s J'1##t *V5e Lz"%%f-  d))&1 1F $::6BB /56!!o6F6 F188 fVn- '  7s'B:C : CCc Ttd|tdtdtdtdd|j|t |}|j d}t |ddi|jd}|Dcic] }|d |d  }}ddd }t ||ycc}w) Nunicode_commentsunicodeu é試蛇ẟΩremojiu ☁️✨u試蛇ẟΩ✨rrkr)rrrrrrrr0rr) r|rrZrtcrrvaluerOs r>test_comments_unicodez-ComponentReflectionTest.test_comments_unicode s   9g ? 7G[ 9$   J'z"  # #$6 7 B)*+ 23267Q6AiL(77)K@ E38sB%c  td|tdtdd|j|t |}|j d}t |ddi|jdd}t |d|d iddiy) Nrru&🐍🧙🝝🧙‍♂️🧙‍♀️ru&🎩🁰🝑🤷‍♀️🤷‍♂️rrrkrr)r|rrZrrrs r>test_comments_unicode_fullz2ComponentReflectionTest.test_comments_unicode_full s   7G-U V<   J'z"  # #$6 7 BABC   / 0 3 QvY) %1Y'Z[r@rr,)NF)mrArBrC run_inserts run_deletesrrDr[rGrhrXrVrrrr r=rrrrpropertyrrrrrrrrrrrrrRschema_reflectionrrr$r&schema_create_deleter*r.r0rrrSr<r@rrDrUrqrGrrKrMrIr"rrkrmrro!primary_key_constraint_reflectionr%r(rrrr+rrrr6rtemp_table_reflect_indexesrr.r rtable_reflectionrrrrrrrCrrrrqrrrrrrrr7rrr rrrcomment_reflection_full_unicoderrEr@r>rErEos7 $$K+KNN k-k-Z  OOB4!)Zoo ^^ Boo ^^ "Loo ^^ ^@77 oo ^^ .`// oo ^^ Vp  oo ^^ sj22 oo ^^  CJ(( oo ^^ 8t## ''G(G  ''8(8  '' G( G '' 8( 8 '' ** ;+( ; ''>(>  ''N(NW ((JJK W w''(%,!- !-FW w''(%, - - &&D'D  %% %%6&&6  ((,), (( H)H 0W g&&../ ug&&667      $ $w'7'7'G'G G ( <6 <6B ++  ,   +++,+ ++ ,, %%B&-,B W4))112\ 77 8 :W4))112\ 77$>8$>L 00 "81"8HW4))112\ && ' ,W3/  && ** 22 -3+'  - ++ 22D3,D 00 1 W w''((\ 22VD3VDp %%W4))112\& %%.&. &&2'20W w''((\ ? ?W4!1!1!9!9:EB /C / __//b ++,  (( 9) 9; 50LL" 778$* 77H8H& &&K'K  22P3P" 11H2H"W g..DDE     > >     > >  ((99: $    9 9 $    8 8  g..AAB+.*/.* W$ =W w%%&.>." (()( 55\6\r@rEceZdZdZdZej dZej dZdZ dZ dZ ejjdZejjd Zy ) TableNoColumnsTest)reflect_tables_no_columnsTc>td||j|yNr)rrr|rrZs r>table_no_columnsz#TableNoColumnsTest.table_no_columns s gx J'r@ctd|tj|dtdtj|dtd|j |y)Nrr]z*CREATE VIEW empty_v AS SELECT * FROM emptyr^zDROP VIEW IF EXISTS empty_v)rrr`r#rr)s r>view_no_columnsz"TableNoColumnsTest.view_no_columns sR gx    < =   mS)F%G  J'r@cntdt|}tt|jgy)Nrrrrrrr)r|rr*t2s r>test_reflect_table_no_columnsz0TableNoColumnsTest.test_reflect_table_no_columns s$ 7HJj A DJr@ct|}t|jdg|j}t|dgiy)Nrr()rrrr)r|rr*rmultis r>!test_get_columns_table_no_columnsz4TableNoColumnsTest.test_get_columns_table_no_columns s>z" D  W %r*&&( EOR()r@ct}|j|t|jj dgsJyr()rrrrr\)r|rr*rs r>"test_reflect_incl_table_no_columnsz5TableNoColumnsTest.test_reflect_incl_table_no_columns s3 J *188}))7)444r@cntdt|}tt|jgy)Nempty_vrr.)r|rr,r/s r>test_reflect_view_no_columnsz/TableNoColumnsTest.test_reflect_view_no_columns s$ 9hj C DJr@ct|}t|jdg|jtj }t|dgiy)Nr7)r)Nr7)rrrrrr?)r|rr,rr2s r> test_get_columns_view_no_columnsz3TableNoColumnsTest.test_get_columns_view_no_columns sHz" D  Y ',&&JOO&< E%r*+r@N)rArBrCrrrrr*r,r0r3r5rRrr8r:rEr@r>r%r% s1LK __(( __ ( (* 5   ,,r@r%c `eZdZdZej ddgdZej dZdZejjdZ ejjejdd d d d Zejjejddd d dZejjdZejj"dZejj&dZejj*dZdZejj0dZejj0ejej6ej8ej:ej<ejj>fej@ejj>fd dZ!ejj0dZ"ejd dd ejjFfd d dejjHfid dejjHfidd ejjJfd d dejjLfd dd ejjNfd dZ(eje)e*jVd d!fe)d d!fe,e*jZd"fe)e*jVd#d$ejj\fe)e*jVd%d&ejj\fe/e0jbd'fe)e*jdd(e*jdd)zd$ejj\fd* ejjfd+Z4y ),ComponentReflectionTestExtraTF)paramsc<|jrtjSyr)paramrrT)r|requests r>use_schema_fixturez/ComponentReflectionTestExtra.use_schema_fixture s ==%% %r@c@tjfd}|S)Nc3NKtfjywr)rr)rrrZrAs r>goz:ComponentReflectionTestExtra.inspect_for_table..go s%$gj&99 9    +s"%) contextlibcontextmanager)r|rZrrArDs ``` r>inspect_for_tablez.ComponentReflectionTestExtra.inspect_for_table s"  " " , # ,  r@c d}t|Dcgc]}|d||ddc}d}t|d}t||ycc}w)Ncdjtjd|jtjS)N zand|\d|=|a|b|c|or|<|>)joinrfindallrI)rs r> normalizez5ComponentReflectionTestExtra.ck_eq..normalize s.88 3W]]_bddK r@rkrrkrc |dSrrEitems r>rz4ComponentReflectionTestExtra.ck_eq.. d9or@rc |dSrrErQs r>rz4ComponentReflectionTestExtra.ck_eq.. rSr@)r7r)r|rrrNrRs r>ck_eqz"ComponentReflectionTestExtra.ck_eq se  & f)DO2LM /   .  Ix  sA c |d5\}}td|tdtjd|ddd|j j dgy#1swY-xYw)NrurMrhrP)rrrnrrUr3)r|rZrGrQrs r>#test_check_constraint_no_constraintz@ComponentReflectionTestExtra.test_check_constraint_no_constraint so / 0 4GVY  vryy}-     + +, 1 AND a < 5rrMrNrPa > 1 and a < 5rO) rrrrnr rr3rUr+r=r|rZrGrZrQrrs r>test_check_constraint_inlinez9ComponentReflectionTestExtra.test_check_constraint_inline+ sw ' +>FI tWYD9I&&)vvbz*   33GF3K  ,7txx0  %  s A$B11B: my_ck_const MyCkConstc (|d5\}}td|tdttjd||dddj d}|j ||xstjddgy#1swYExYw)Nr\rza = 1 OR (a > 2 AND a < 5)rrPza = 1 or a > 2 and a < 5rO) rrrrnr r3rUr+r=r_s r> test_check_constraint_standalonez=ComponentReflectionTestExtra.test_check_constraint_standaloneO sw ' +>FI sGI&""0  33GF3K  ,7txx9    s ;BBcz|d5\}}td|tdtdtdttjdtdttjdd td ttd t d tj d d tjdd tj d d | dddjd}|j|dddd ddtjddgy#1swYIxYw)Nr\rJTrKrr]rzb > 1 AND b < 5rXrrrMrNsome_uqzc > 1 AND c < 5cc1 some_c_uqrPzc > 1 and c < 5rOzb > 1 and b < 5r^) rrrrnr rr r3rUr+r=)r|rZrGrQrrs r>test_check_constraint_mixedz8ComponentReflectionTestExtra.test_check_constraint_mixedm s w ' +>FI tWYD9sGIr'9'9:K'LMI&&'8{K sGI&vvbz*##F;""#45A##Ck:  &33GF3K  +<=$1BC.?@  +  s C D11D:c |d5\}}td|tdtdtdttdt}td|jj |jj |jjdddjd}t|d d gd y#1swY/xYw) ztest for #12894sa_multi_indexColumn1TrKColumn2Column3 Index_ExampleNrr)rnrlrm) rrrr$rrnrlrmr*r)r|rZrGrQrrIrs r>test_index_column_orderz4ComponentReflectionTestExtra.test_index_column_order s/ 0 4GVY y't<y'*y'* J  $$ $$ $$   ''(89 GAJ~ &(IJ  s B CC c . td|tdtdtdtdtdtd}tdt j |j j|j jt j |j jd tdt j|j j td |j j|jt}d dgd id g}fd }||d Gddt}G fddt}tjj j"rdgd|dd|dgd d} || |j%d | ddg|d dgd d} || |j'| t)|j+d|t-} td| } nGt/d5t)|j+d|t-} td| } ddd|j1 |j2j4y#1swY1xYw)Nr:xr`yzt_idxalong 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 t_idx_longt_idx_2F)rkrrarctjjjr$g|d<jj dgi|d<y|j diy)Nr_includer)rrRrr7r-rkr)entryrs r> completeIndexzYComponentReflectionTestExtra.test_reflect_expression_based_indexes..completeIndex s\??GG+-'(!((--.h7,'(  !2B7r@rceZdZdZy)[ComponentReflectionTestExtra.test_reflect_expression_based_indexes..lower_index_strcB|j}d|vxr d|vxsd|vS)Nrrrrsr)r|rols r>rzbComponentReflectionTestExtra.test_reflect_expression_based_indexes..lower_index_str.__eq__ s)[[]"}A#)*@sbyAr@NrrEr@r>lower_index_strr} s Br@rceZdZfdZy)^ComponentReflectionTestExtra.test_reflect_expression_based_indexes..coalesce_index_strc4d|jvxr|vS)Ncoalescer)r|rlong_strs r>rzeComponentReflectionTestExtra.test_reflect_expression_based_indexes..coalesce_index_str.__eq__ s!U[[]2Hx57HHr@Nr)rsr>coalesce_index_strr s  Ir@r)NrtNzlower(x)zlower(y))rkrrraz coalesce(x, 'z')rz>Skipped unsupported reflection of expression-based index t_idx)rrrr$rrrrrrtrsrrrrrrR reflect_indexes_with_expressionsr7insertrrr*rr !compare_table_index_with_expectedr-rk)r|rZrr:rrr{rr expr_indexexpr_index_longrr/rs ` @r>%test_reflect_expression_based_indexeszBComponentReflectionTestExtra.test_reflect_expression_based_indexes sD    3r # 3r # 3r #   gtzz!##%%(!##%%ACCEE1BC' lDMM!##%%:; iJ'z""!$#%    8 hqk" Bc B  I I    < < D D 1#J/#J/    J * % OOAz *%!%&xj'CD  O / * OOO ,   %x 0BsBj9B  >D$$S)84Z3*=  > .. *++00  > >s '4J  Jc td|tdtdtdtd}td|jj }dg|j |jjd<|j|t|}|jd}t|ddgdgdtjdgt|d d d |jjzdgtdt| }tt!|j"d j |jjddgy) Nr:rrr`rsruincludeF)rkrrrarrrz %s_includer)rrrr$rrrrr-rkrrr*rr+r=rrr)r|rZrr:rrr*r/s r>test_reflect_covering_indexz8ComponentReflectionTestExtra.test_reflect_covering_index sE    3r # 3r #   GQSSUU#BEJ--223I>J'z"&&s+  $%(E(+u#'+xx    N, -z00555 E  3 * =  Q  / / 0A0A0F0F G E  r@c td|gt|Dcgc]\}}td|z|c}}}|j|t |j dDcgc]}|d c}Scc}}wcc}w)Nr:zt%dr)rrUrrrr)r|rrZrrdtype_r:rs r>_type_round_tripz-ComponentReflectionTestExtra._type_round_trip' s{    8A7G H81efUQY& H  #*:#6#B#B3#GHa& HH IIs A3 $ A9c|j||tjddD]J}t|tjsJt |j dt |j dLy)NrO)rrYr]rr precisionscale)r|rrZtyps r>test_numeric_reflectionz4ComponentReflectionTestExtra.test_numeric_reflection1 sd(( )"3"3B":  Cc9#4#45 55  r "  1   r@rc|j|||dd}t|tjrt |tjsTJt|tj rt |tj sJt |tj sJt|jdt |jtsJy)N4r) r issubclassrYrprrrrlengthint)r|rrZrrs r>test_string_length_reflectionz:ComponentReflectionTestExtra.test_string_length_reflection: s##J%)DQG eY.. /c9#4#45 55 y~~ .c9>>2 22c9#3#34 44 CJJ#**c***r@c td|tdtdtdtd}|j|t t |j dDcic] }|d|d c}ddd ycc}w) Nr:rTrPrFrkrQ)rr)rrrrrrr)r|rrZr:rs r>test_nullable_reflectionz5ComponentReflectionTestExtra.test_nullable_reflectionO s    3$ / 3% 0    #:.::3? F S_, U #   s!A=CASCADEzSET NULLz NO ACTIONRESTRICTzexpected,ondelete,onupdatec i}|r||d<|r||d<||}td|tdtddtd|tdtdtd ttd d td t ddtd|tdtdtdt ddtdtt j dgdgfddi|d|j|t|}|jddd}t|D cic]} || s | || c} i|jddd}t||ycc} w)NondeleteonupdaterrrJTrKrrbx_idzx.idxidrtest userrkrNFrPtidztable.idmyfkrr4) rrrrrrnrrrr'r) r|rrZrrrr4roptsrs r>test_get_foreign_key_optionsz9ComponentReflectionTestExtra.test_get_foreign_key_options` spT "*GJ  "*GJ   H   4d 3      4d 3 67JvE$B C 66": &      4d 3 66": 6 5' "  # #* ,2 6=   J'z"$$W-a0;  1AaQQZ 126$$V,Q/ : D( 2s  E'E10z'?10'?z1|truez3 + 5z3\+5z(3 * 5)z3\*5zcurrent_timestamp|now|getdate35zdatatype, default, expected_regc  td|tdtdtd||}|j|t |j ddd}t jd d |}t||t j y) Nr:rJTrKthecol)server_defaultrrz [\(\) \']rJ)flags) rrrrrrrrr IGNORECASE) r|rZrdatatyper expected_regr:rreflected_sanitizeds r>test_server_defaultsz1ComponentReflectionTestExtra.test_server_defaults s}:    4d 3 8Xg >   J'33C8;IF  ff\2yA$l"--Hr@)5rArBrCrrrrArGrUrRr7rW"inline_check_constraint_reflectionrr`rdriindexes_check_column_orderrpindexes_with_expressionsrrrrr"rrYrrprNVARCHARnvarchar_typesNCHARrr1foreign_key_constraint_option_reflection_ondelete1foreign_key_constraint_option_reflection_onupdate1fk_constraint_option_reflection_ondelete_noaction1fk_constraint_option_reflection_onupdate_restrict1fk_constraint_option_reflection_ondelete_restrictrrrnrrtrueexpression_server_defaultsrrnowliteral_columnserver_defaultsrrEr@r>r<r< s-KW__T5M*+ W__!. 11  2   88WZ0A 9 @ 11W{D3D 2 4 88 9 > 00K1K& ..X /X t 55( 6( TI &&' &&W   W--<<= '**99:  +' + && ' W       N N         N N         N N         N N         N N         N N  .K&N3O&N3lW '"''$-+ $ " '"'')Y'  BGGG      7 7    BGGI      7 7  8488:?@  B  c "%6R%6%6s%; ;     7 7  3/2 %% I&34 Ir@r<c0eZdZdZdZedZdZdZy)NormalizedNameTest)denormalized_namesTc ttdd|tdtdttdd|tdtdtdt dy) NrTrrJrKr/t1idzt1.id)rr%rrrrYs r>r[z NormalizedNameTest.define_tables sU D )  4d 3  D )  4d 3 6:g. /  r@ct}ttdd|tj}|j d}|j jj|j jsJt}|jtjd|j dj jj|j dj jsJy)Nr/Trrrc&|jdvS)Nrr/r)rkrs r>rzINormalizedNameTest.test_reflect_lowercase_forced_tables.. sDJJLL,Hr@)only) rrr%rr<rrrrrJr)r|rt2_reft1_refm3s r>$test_reflect_lowercase_forced_tablesz7NormalizedNameTest.test_reflect_lowercase_forced_tables s Z D )2VYY 4xx}}'' 444 Z IIH  yy  %%0041B1B1E1EFFFr@cRttjjDcgc]}|j dvr|}}t |dj |dj t |dj |dj ycc}w)Nrrr)rrr<r6rrupper)r|r: tablenamess r>r<z'NormalizedNameTest.test_get_table_names sVYY'779 wwyL(   JqM   !:a=#6#6#89 JqM   !:a=#6#6#89 sB$N) rArBrCrrrDr[rr<rEr@r>rr s)*LK     G:r@rc\eZdZdZdZdZdZejjdZ y)ComputedReflectionTestcttj}|jd}|Dcic]}|d| }}t d|ddvt |dddt |dddycc}w)Ncomputed_default_tablerk42 with_defaultrnormal computed_col)rrr<rr*r )r|rrrcol_datas r>!test_computed_col_default_not_setz8ComputedReflectionTest.test_computed_col_default_not_set svyy! 89*./QAfIqL//0;;< HX y )40 H^ $Y /60s A6cTttj}|jd}|Dcic]}|d| }}dD]}t d||v|d}t d|vt d|dvt |j |dddt d|dvtjjjtjjjr5t |ddtjjjyycc}w) Nrrk)rJrrcomputedrr normal+42 persisted) rrr<rr*rrNrrR"computed_columns_reflect_persistedr7"computed_columns_default_persisted)r|rrrrMrcompDatas r> test_get_column_returns_computedz7ComputedReflectionTest.test_get_column_returns_computed svyy! 89&*+& 1 ++3 1C Jd3i/ 0 1' h&' Xj112 DNN8J/ : ;[I 8J/ /    ? ? G G     > > F F $[1  CCKK  G,s D%ctd||v||d}t|j|d|tjj j rtd|vt|d|yy)Nrrr)r*rrNrrRrr7r )r|rMcolumnrrrs r> check_columnz#ComputedReflectionTest.check_column1 sp d6l*+< + DNN8I. /9    > > F F K8+ , %y 1 Gr@cttj}|jd}|Dcic]}|d| }}|j |ddt j jjt j jjr|j |dddt j jjr|j |dd d yycc}w) Ncomputed_column_tablerkcomputed_no_flagrcomputed_virtualznormal+2Fcomputed_storedz normal-42T) rrr<rrrrRrr7computed_columns_virtualcomputed_columns_storedr|rrrrMs r>!test_get_column_returns_persistedz8ComputedReflectionTest.test_get_column_returns_persisted9 svyy! 78&*+& 1 ++        ? ? G G     4 4 < <   "      3 3 ; ;   !   <,s C&cttj}|jdtj}|Dcic]}|d| }}|j |ddt jjjt jjjr|j |dddt jjjr|j |d d d yycc}w) NrrPrkrz normal/42rznormal/2Frz normal*42T) rrr<rrTrrrRrr7rrrs r>-test_get_column_returns_persisted_with_schemazDComputedReflectionTest.test_get_column_returns_persisted_with_schemaT svyy! #F,>,>  '++& 1 ++        ? ? G G     4 4 < <   "      3 3 ; ;   !   <,s C6N) rArBrCrrrrrrRrSrrEr@r>rr s67*26 r@rcpeZdZdxZZdZdZedZdZ dZ e jjdZy)IdentityReflectionTestNT)rr"ctd|tdttdtttd|tdttdddd d dd tj j jrGtd|tdttdttdd tjyy)Nrrid1r/rTrrrralwaysr incrementminvaluemaxvaluecyclecacherh)rrrP) rrrrrrRrSr7rrTrYs r>r[z$IdentityReflectionTest.define_tablesy s   8W % 5'8: .       "    # # + + x)ugxt2'FG))   ,r@ctjjjrd}t |D]}||vs|j ||rlt t|t||D]H}|dk(rt||||k|dvrt||||k\6t |||||Jyt ||yt |d|dt |d|dy)Nrr>r rrr) rrRidentity_columns_standardr7rrrrTr*)r|rrOapprox common_keysrs r>checkzIdentityReflectionTest.check s    5 5 = =K%[ !K'IIaL !CJC)1AJaCF 2333aCF 23E!Hc!fa0 1E3 gG - k"C $4 5r@c .ttj}|jd|jdz}|D]}|ddk(rt d|v|ddk(rVd|vrt |dt |ddt d|v|j|dtd d d d d d d d w|ddk(sd|vrt |dt |ddt d|v|j|dtd ddddd d d y)Nrr/rkrrrrrFrrTr rrrrrrr) rrr<rr)r*rrr:r|rrrs r>rz,IdentityReflectionTest.test_reflect_identity sFvyy!%(8(8(>>& C6{h&s*+V%"c)C01C ND) c)*  O$"#!"!+#  V%"c)C01C ND) c)*  O#"#!#!#"! 5& r@c nttj}|jdtj}|D]v}|ddk(rt d|v|ddk(s"d|vrt |dt|ddt d|v|j|dtd d d d d d d d xy)NrrPrkrrrrrTrhrrFrr) rrr<rrTr)r*rrr:rs r>test_reflect_identity_schemaz3IdentityReflectionTest.test_reflect_identity_schema svyy!V-?-?@ C6{h&s*+V%"c)C01C ND) c)*  O# "#!"!+#   r@)rArBrCrrrrrDr[rrrrRrSrrEr@r>rrs sT $$K+K;LB6:*X r@rceZdZdZedZejjdZ ejjdZ y)CompositeKeyReflectionTestTc2td|tdttdttdtjdt j dddddd }td |tdtd td ttd ttdtjdt jgd|jj|jj|jjgddd y)Ntb1rJattrrkrhpk_tb1rTrYtb2rKpidpattrpnamerrrfk_tb1_name_id_attr) rrrrYrprnr rrrkrJr)r=rZrs r>r[z(CompositeKeyReflectionTest.define_tables s   4 ! 67 # 69,,R0 1  # #FD&x H      4d 3 5' " 7G $ 7I--b1 2  # #)SUUXXsuuzz2*   r@ct|}|j|jjj}t |j dgdy)NrrkrJr)rr$rrrkrr)r|rrrLs r>test_pk_column_orderz/CompositeKeyReflectionTest.test_pk_column_order sAz",,T[[__-A-AB  KOO1 24JKr@c t|}|j|jjj}t t |d|d}t |jdgdt |jdgdy)Nrrrr"rr)rr'rrrkrrTr)r|rr foreign_keysrzs r>test_fk_column_orderz/CompositeKeyReflectionTest.test_fk_column_order& snz",,T[[__-A-AB  C q!Q EII( )+AB EII+ ,.GHr@N) rArBrCrrDr[rrRr r#rr&rEr@r>rr s]K  6 77L8L  77I8Ir@r) rEr<r%rrrGrrrrrr)HrErrr8rnrJrrrrrr r r r provisionr rrQrrrrrrrrrrrrrrrYr-rrr excr!r"r#r$ sql.elementsr% sql.schemar&r'r(r)r*r+rZrL TablesTestr.rGrTestBaserrrrCrEr%r<rComputedReflectionFixtureTestrrr__all__rEr@r>r/s $+/" !#*'&&%% h11  S:*S:lJ 8&&J ZdG8,,dGN#GH--#GLT0X00T0n1