HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyc
�
���ec
@sddlZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lm
Z
ddlmZddlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dl m!Z!d
dlm"Z"d
dlm#Z#e$e$f\Z%Z&de	j'fd��YZ(d e(fd!��YZ)d"e	j'fd#��YZ*d$e	j'fd%��YZ+d&e(fd'��YZ,d(e	j-fd)��YZ.d*e	j-fd+��YZ/d,e	j'fd-��YZ0d.e	j1fd/��YZ2d0e	j'fd1��YZ3d2e	j'fd3��YZ4d&d*d(d$d d"d,d.d0d2f
Z5dS(4i����Ni(tconfig(tengines(teq_(texpect_warnings(tfixtures(tis_(tget_temp_table_name(ttemp_table_keyword_args(tColumn(tTablei(tevent(t
ForeignKey(tfunc(tIdentity(tinspect(tInteger(tMetaData(tString(ttesting(ttypes(tDDL(tIndex(tquoted_name(tBLANK_SCHEMA(tis_false(tis_truetOneConnectionTablesTestcBseZed��ZRS(cCsLtjjjrAddlm}tjdtd|j	dd��Stj
SdS(Ni����(tpooltoptionst	poolclasstscopetclass(Rtrequirementstindependent_connectionstenabledt
sqlalchemyRRttesting_enginetdictt
StaticPooltdb(tclsR((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt
setup_bind+s
	(t__name__t
__module__tclassmethodR)(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR*stHasTableTestcBseZeZed��Zed��Zed��Zed��Zd�Z	e
jjd��Z
e
jdd�e
jjd���Ze
jjd	��Ze
jje
jje
jjd
����Ze
jdd�e
jje
jjd����ZRS(
cCs�td|tdtdt�tdtd���tjjjr}td|tdtdt�tdtd��dt	j
�ntjjr�|j|�ntjj
jr�|j|�ndS(Nt
test_tabletidtprimary_keytdatai2ttest_table_stschema(R	RRtTrueRRtrequirestschemasR"Rttest_schematview_reflectiontdefine_viewsthas_temp_tabletdefine_temp_tables(R(tmetadata((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt
define_tables=s 
cCs�d}tj|dt|��tj|dtd��tjjjr�dtjtjf}tj|dt|��tj|dtdtj��ndS(Ns1CREATE VIEW vv AS SELECT id, data FROM test_tabletafter_createtbefore_dropsDROP VIEW vvs9CREATE VIEW %s.vv AS SELECT id, data FROM %s.test_table_ssDROP VIEW %s.vv(	R
tlistenRRR5R6R"RR7(R(R<tquery((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR9Ss
cCstttjdtjf�S(Nsuser_tmp_%s(RRR'tident(R(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttemp_table_nameiscCs�tttj�}|j�}t||tdtjdt�tdtj	d��|�}t
jjj
r�t
jjj
r�tj|dtdtj��tj|dtd��ndS(	NR/R0tnamei2R>s=create temporary view user_tmp_v as select * from user_tmp_%sR?sdrop view user_tmp_v(RRR'RCR	RtsatINTR4tVARCHARRR5R8R"ttemporary_viewsR
R@RRB(R(R<tkwt
table_nametuser_tmp((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR;os"	cCsptjj��[}ttjjj|d��ttjjj|d��ttjjj|d��WdQXdS(NR.R2tnonexistent_table(RR'tbeginRtdialectt	has_tableR(tselftconn((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_table�sc
Cs�tjj��v}ttjjj|ddtj��ttjjj|ddtj��ttjjj|ddtj��WdQXdS(NR.R3R2RL(RR'RMRRNROR7R(RPRQ((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_table_schema�storaclesJper #8700 this remains at its previous behavior of not working within 1.4.cCs#t|�}t|jd��dS(Ntvv(RRRO(RPt
connectiontinsp((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_table_view�scCs/t|�}|j�}t|j|��dS(N(RRCRRO(RPRVRWRC((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_table_temp_table�scCs#t|�}t|jd��dS(Nt
user_tmp_v(RRRO(RPRVRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_table_temp_view�ssIper #8700 this remains at its previous behavior of not working within 1.4cCs)t|�}t|jdtj��dS(NRU(RRRORR7(RPRVRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_table_view_schema�s(R*R+R4t__backend__R,R=R9RCR;RRRR5R6RStfails_ontviewsRXR:RYR8RHR[R\(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR-:s(				tHasIndexTestcBs;eZeZed��Zd�Zejj	d��Z
RS(cCs�td|tdtdt�tdtd���}td|jj�tj	j
jr�td|tdtdt�tdtd��dtj
�}td|jj�ndS(	NR.R/R0R1i2tmy_idxR3tmy_idx_s(R	RRR4RRtcR1RR5R6R"RR7(R(R<ttt((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR=�scCs�tjj���}tjjj|dd�s3t�tjjj|dd�sUt�tjjj|dd�swt�tjjj|dd�s�t�WdQXdS(NR.RaRbRLtnonexistent_idx(RR'RMRNt	has_indextAssertionError(RPRQ((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_index�s!c
Cs�tjj���}tjjj|dddtj�s<t�tjjj|dddtj�sgt�tjjj|dddtj�s�t�tjjj|dddtj�s�t�WdQXdS(NR.RbR3RaRLtnonexistent_idx_s(RR'RMRNRfR7Rg(RPRQ((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_index_schema�s(R*R+R4R]R,R=RhRR5R6Rj(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR`�s	
tQuotedNameArgumentTestcBs�eZdZeZed��Zd�Zed��Zee	j
jd���Zed��Z
ed��Zed��Zed��Zee	j
jd	���Zee	j
jd
���Zee	j
jd���ZRS(toncecCstd|tdt�tdtd��tdtd��tdt�tjddd�tjdd�tjddd	�tjdgd
gdd�tj	ddd
�dddt
�tjj
jr|td|tdt�tdtd��tdtd��tdt�tjddd�tjdd�tjddd�tjdgd
gdd�tj	ddd�dddt
�ntd|tdtdt
�tdt�dt
�tjjjr{tjj
jr�ddg}n	dg}x�|D]�}dtjjjjd|�tjjjj|�f}tj|dt|��tj|dtdtjjjjd|���q�WndS(Nsquote ' oneR/RDi2R1t
related_idspk quote ' onesix quote ' ones
uq quote' ones
related.idsfk quote ' ones
name != 'foo'sck quote ' onetcommentsquote ' one commentt
test_needs_fksquote " twospk quote " twosix quote " twos
uq quote" twosfk quote " twosck quote " two squote " two commenttrelatedR0s"CREATE VIEW %s AS SELECT * FROM %ssview %sR>R?sDROP VIEW %s(R	RRRREtPrimaryKeyConstraintRtUniqueConstrainttForeignKeyConstrainttCheckConstraintR4RR5tsymbol_names_w_double_quoteR"tview_column_reflectionRR'RNtidentifier_preparertquoteR
R@R(R(R<tnamesRDRA((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR=sv
	

cCs"tjddtjjf�|�S(Nsquote ' onesquote " two(squote ' one(RtcombinationsR5Ru(tfn((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pytquote_fixturesWscCs ttj�}|j|�dS(N(RRR'tget_table_options(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_options]scCs,ttj�}|jd|�s(t�dS(Nsview %s(RRR'tget_view_definitionRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_view_definitioncscCs(ttj�}|j|�s$t�dS(N(RRR'tget_columnsRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_columnsiscCs(ttj�}|j|�s$t�dS(N(RRR'tget_pk_constraintRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_pk_constraintnscCs(ttj�}|j|�s$t�dS(N(RRR'tget_foreign_keysRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_foreign_keyssscCs(ttj�}|j|�s$t�dS(N(RRR'tget_indexesRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_indexesxscCs(ttj�}|j|�s$t�dS(N(RRR'tget_unique_constraintsRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_unique_constraints}scCs(ttj�}|j|�s$t�dS(N(RRR'tget_table_commentRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_comment�scCs(ttj�}|j|�s$t�dS(N(RRR'tget_check_constraintsRg(RPRDRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_check_constraints�s(R*R+trun_create_tablesR4R]R,R=R|R~RR5RvR�R�R�R�R�tunique_constraint_reflectionR�tcomment_reflectionR�tcheck_constraint_reflectionR�(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRk�s"T	tComponentReflectionTestc
Bs�eZd,ZZeZed��Zed��Z	ed��Z
ed��Zed��Ze
jjd��Ze
jjd��Ze
jjd��Ze
jjd��Ze
jje
jd,eeefd,eeee
jjfd	eeefd,eeefd,eeee
jjfd,eeefd,eeee
jjfd
d�d���Ze
jjd
��Ze
jje
jje
jjd����Ze
jjd��Ze
jje
jjd���Z d,d�Z!e
jeefeee
jjfeee
jjfeee
jje
jjfd
d�d��Z"e
jj#d��Z$e
jj#e
jj%e
jjd����Z&e
jefee
jjfd
d�e
jj'd���Z(e
jefee
jjfd
d�e
jjd���Z)e
jj*e
jjd���Z+d�Z,e
jefee
jjfd
d�d��Z-e
jd-d.d
d �e
jj.e
jj/d!����Z0e
jj#e
jj1d"���Z2e
jj3d#��Z4e
jee
jjfefd
d�e
jj1d$���Z5e
jje
jefee
jjfd
d�d%���Z6e
jd&efd&ee
jjfd
d'�e
j7d(d)�d*���Z8e
jj9d+��Z:RS(/cCs<|j|d�tjjjr8|j|tjj�ndS(N(tdefine_reflected_tablestNoneRR5R6R"RR7(R(R<((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR=�sc
Cs�|r|d}nd}tjjjr�td|tdtjdt�tdtj	d�dt
�td	tjd�dt
�td
tjtj
d|dd
��d|dt�}nftd|tdtjdt�tdtj	d�dt
�td	tjd�dt
�d|dt�}td|tdtjdt�tdtjtj
d|��tdtjd��d|dt�td|tdtj�tdtjtj
|jj��tdtjd��tjddd�d|dt�td|tdtjdtdd�tdtjd�dd�td tjd�dd!�d|dd"�tjjjr�|dkr�td#|tdtjdt�tdtjd��td$t
d%tjj��dtdtjjj�q�td&|tdtjdt�td't
d(tjjj��tdtjd��d|dt�td)|tdtjdt�tdtjd��d|dt�ntjjjr^|j||�|s^td*|td+tjd��dt�}td,|tdtjdt�td+tjd��dt�}tjjjr[td-|jjj��td.|jjj��q[q^ntjjjr�|j ||�n|r�tjj!jr�|j"|�ndS(/Nt.ttuserstuser_idR0ttest1itnullablettest2tparent_user_ids%susers.user_idRDt
user_id_fkR3Rot
dingalingstdingaling_idt
address_ids%semail_addresses.address_idR1itemail_addressestremote_user_idt
email_addressitemail_ad_pktcomment_testR/Rns
id commentsdata % commenttd2s)Comment types type speedily ' " \ '' Fun!sthe test % ' " \ table commenttlocal_tablet	remote_ids%s.remote_table_2.idtremote_tabletlocal_ids%s.local_table.idtremote_table_2tnoncol_idx_test_nopktqtnoncol_idx_test_pktnoncol_idx_nopkt
noncol_idx_pk(#RR5tself_referential_foreign_keysR"R	RRERFR4tCHARtFalsetFloatRRRRcR�Rqtcross_schema_fk_reflectionR�RR7R'RNtdefault_schema_nametindex_reflectiontdefine_indextindexes_with_ascdescRR�tdescRvR9ttemp_table_reflectionR;(R(R<R3t
schema_prefixR�R�R�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��s�
		
		"cCs�tttj�}tttjdtj�}t||tdtjdt	�tdtj
d��tdtj�tjdddtj�tjdd�|�}t
jjjr�t
jjjr�tj|d	td
tj��tj|dtd��ndS(
Nsuser_tmp_%sR/R0RDi2tfoosuser_tmp_uq_%stuser_tmp_ixR>s=create temporary view user_tmp_v as select * from user_tmp_%sR?sdrop view user_tmp_v(RRR'RRBR	RRERFR4RGRrRRR5R8R"RHR
R@R(R(R<RIRJRK((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR;+s*	cCsEtd|jj|jj�td|jj|jj|jj�dS(Ntusers_t_idxt
users_all_idx(RRcR�R�R�(R(R<R�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�OscCs�x}d	D]u}|}|r,d||f}n|d}d||f}tj|dt|��tj|dtd|��qWdS(
NR�R�s%s.%st_vs"CREATE VIEW %s AS SELECT * FROM %sR>R?sDROP VIEW %s(R�R�(R
R@R(R(R<R3RJtfullnamet	view_nameRA((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR9Ts


cCs2t|j�}|jtjj|j�k�dS(N(Rtbindtassert_RRR7tget_schema_names(RPRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_schema_namesescCsU|jdidd6tjjt6�}t|�}|jtjj|j�k�dS(s
test #7300tschema_translate_maptbarR�N(texecution_optionsRRR7RRR�R�(RPRVRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt%test_get_schema_names_w_translate_mapks	cCs2tj�}t|�t|jd�s.t�dS(NR�(RR$RthasattrRNRg(RPtengine((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_dialect_initializeys
cCs,t|j�}t|j|jjj�dS(N(RR�RR�RN(RPRW((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_default_schema_namestforeign_keytargnamess/order_by,include_plain,include_views,use_schemacCsD|rtj}nd}ddddddg}t|�}|r}|j|�}	|	j�ddg}
tt|	�|
�n|r@|r�g|j|�D]}|d	r�|d	^q�}n|j	|�}g|D]}
|
|kr�|
^q�}	|d
krddd
g}
t|	|
�q@d
ddg}
tt|	�|
�ndS(NR�R�R�R�R�R�temail_addresses_vtusers_viR�R�R�R�(
RR7R�Rtget_view_namestsortRtsortedtget_sorted_table_and_fkc_namestget_table_names(RPRVtorder_byt
include_plaint
include_viewst
use_schemaR3t_ignore_tablesRWttable_namestanswertrecttablestt((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_names�s6	
%cCs<t|j�}|j�}tt|�dtjg�dS(Nsuser_tmp_%s(RR�tget_temp_table_namesRR�RRB(RPRWttemp_table_names((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_table_names�scCs5t|j�}|j�}tt|�dg�dS(NRZ(RR�tget_temp_view_namesRR�(RPRWR�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_view_names�scCs|j�dS(N(t_test_get_comments(RP((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_comments�scCs|jtjj�dS(N(R�RRR7(RP((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_comments_with_schema�scCs�t|j�}t|jdd|�idd6�t|jdd|�idd6�tg|jdd|�D]"}i|dd6|dd6^qnidd6d	d6id
d6dd6idd6d
d6g�dS(NR�R3sthe test % ' " \ table commentttextR�RDRns
id commentR/sdata % commentR1s)Comment types type speedily ' " \ '' Fun!R�(RR�RR�R�R�(RPR3RWR�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��s#8suse_views,use_schemacCs|rtj}nd}|jj|jj}}|rFddg}nddg}t|�}x�t|||f�D]�\}	}
|}|j|	d|�}|j	t
|�dkt
|��xKt|
j�D]:\}
}t
|j||
d�||
dj}|j}t|tjj�r,|j}ntjd	�r_|tjtjfkr_tj}n|j	t
t|j�j|j�jtjtjtjtjtjtj tj!g��dkd
|j|j||
d|f�|j"s�||
ddkst#�q�q�WqtWdS(NR�R�R�R�R3iRDttypeRTs%s(%s), %s(%s)tdefault($RR7R�R�R�R�RtzipR�R�tlent	enumeratetcolumnsRRDt	__class__R�t
isinstanceRERt
TypeEngineRtagainstt	sql_typestDatetDateTimetsett__mro__tintersectionRtNumerictTimeRt_BinaryR0Rg(RPRVt	use_viewsR�R3R�t	addressesR�RWRJttabletschema_nametcolstitcoltctypet	ctype_def((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��sL
""	"	cCs�tt|jdtj�}|j|}t|j�}|j|�}|jt|�dkt|��x5t	|j
�D]$\}}t|j||d�qyWdS(Nsuser_tmp_%siRD(
RRR�RBR�RR�R�R�R�R�RRD(RPRJRKRWRRR((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_table_columns7s
"cCsOt|j�}|jd�}tg|D]}|d^q(dddg�dS(NRZRDR/R�(RR�R�R(RPRWRR((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_view_columnsDsR�cCs�|rtjj}nd}|jj|jj}}t|�}|j|j	d|�}|d}t
|dg�|j|j	d|�}	|	d}
t
|
dg�tjjj
��t
|	dd�WdQXdS(NR3tconstrained_columnsR�R�RDR�(RRR7R�R�R�R�RR�RDRR5treflects_pk_namestfail_if(RPRVR�R3R�RRWt
users_constusers_pkeyst	addr_const
addr_pkeys((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�Ls

cCs�|rtj}nd}|jj|jj}}t|�}|}tjj	j
r|j|jd|�}|d}	tjj
j��t|	dd�WdQXt|	d|�t|	d|j�t|	ddg�tjj	j
rt|	d	d
g�qn|j|jd|�}
|
d}	tjjj��|j|	ddk	�WdQXt|	d|�t|	d|j�t|	ddg�t|	d	dg�dS(NR3iRDR�treferred_schematreferred_tabletreferred_columnsR�RR�R�(RR7R�R�R�R�RRR5R�R"R�RDtnamed_constraintsRRtimplicitly_named_constraintsR�(RPRVR�R3R�RRWtexpected_schematusers_fkeystfkey1t
addr_fkeys((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�ds0

c	Csp|jd|jjjdtjjdtjj�\}}}t|j�}|j|j	�}t
t|�d�|d}t
|dtjj�t
|d|j	�t
|dd	g�t
|d
dg�|j|j	dtjj�}t
t|�d�|d}|dd|jjjfks0t
�t
|d|j	�t
|dd	g�t
|d
d
g�dS(Ns%s.local_tables%s.remote_tables%s.remote_table_2iiRRRR/RR�R3R�(R�R�RNR�RRR7RR�RDRR�R�Rg(	RPR�R�R�RWtlocal_fkeysRtremote_fkeystfkey2((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt"test_get_inter_schema_foreign_keys�s,


cCs�g|D]}|d^q}xa|D]Y}|d|ks@t�||j|d�}x#|D]}t||||�q^Wq$WdS(NRD(RgtindexR(RPtindexestexpected_indexestdtindex_nameste_indexR tkey((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_assert_insp_indexes�s

cCs�|rtj}nd}t|j�}|jdd|�}itd6ddgd6dd6itd6d	ddgd6d
d6g}|j||�dS(NR�R3tuniqueR�R�tcolumn_namesR�RDR�R�(RR7R�RR�R�R�R'(RPRVR�R3RWR!R"((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��s

R�R�R�R�stname,ixnamecCs�t|�}|j|�}itd6|d6g}|j||�t|t�d|�}tt|j�d�t	t
|j�dj|�tt
|j�dj|�dS(NR(RDt
autoload_withii(
RR�R�R'R	RRR�R!RtlistRRD(RPRVttnametixnameRWR!R"R�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_noncol_index�scCsrt|j�}|jdtj�}x|D]}|jdd�q,Wt|idgd6dtjd6g�dS(Nsuser_tmp_%stduplicates_indexRDR)suser_tmp_uq_%s(RR�R�RRBtpopR�R(RPRWt	reflectedtrefl((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt&test_get_temp_table_unique_constraints�s

cCs�t|j�}tttjdtj�}|j|�}x|D]}|jdd�qAWit	d6dgd6dd6g}t
jjj
r�g|dd	<ntg|D]}|ddkr�|^q�|�dS(
Nsuser_tmp_%stdialect_optionsR(R�R)R�RDitinclude_columns(RR�RRR'RBR�R0R�R�RR5tindex_reflects_included_columnsR"R(RPRWRJR!tindtexpectedtidx((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_table_indexes�s
!&cCs�|rtj}nd}tidd6dgd6idd6dddgd6idd6dddgd6id	d6d
dgd6idd6dgd6id
d6dgd6gdtjd��}td|tdtj	d��tdtj	d��tdtj
�td
tj	d��tdtj	d��d|�}x2|D]*}|jtjd|d|d��q9W|j
|�t|�}t|jdd|�dtjd��}	t�}
tt|�t|	��xRt||	�D]A\}}|jdd�}
|
r|
j|
�nt||�q�Wt�}td|d|d|�}	tg|	jD]}|j^qR�}tg|	jD]!}t|tj�rw|j^qw�jdg�}|j|�s�t�|
r�t|
|�t|t��ndS(Ntunique_aRDtaR)tunique_a_b_ctbRctunique_c_a_btunique_asc_keytascR&si.have.dotss
i have spacesttesttbliiR3R/R*(RR7R�R�toperatort
itemgetterR	RRERRtappend_constraintRrtcreateRR�R�RR�R�R0taddRR!RDtconstraintsR�t
differenceR�Rg(RPR<RVR�R3tuniquesRtuct	inspectorR1tnames_that_duplicate_indextorigR2tdupetreflected_metadataR9t	idx_namestuqtuq_names((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�sf	
"
			%
$
c	Csx|rtj}nd}d}d}t|�}|j|d|�}|j|�|j|d|�}|j|�dS(NR�R�R3(RR7R�RRR�(	RPRVR�R3t
view_name1t
view_name2RWtv1tv2((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�gs
R�stable_name,use_schemat
postgresqlsPG specific featurecCsP|rtj}nd}t|�}|j||�}|jt|t��dS(N(RR7R�Rt
get_table_oidR�R�tint(RPRVRJR�R3RWtoid((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_oidyscCsnt|j�}xXd
ddgD]G\}}|j|�}d�|D�|}|jdt�st�qWd	S(
s�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�cSsi|]}||d�qS(RD((t.0Rc((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys
<dictcomp>�s	t
autoincrementN(R�R�(R�R�(R�R�(RR�R�tgetR4Rg(RPRWR,tcnameRtid_((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_autoincrement_col�sN(R�R�(R�R�(;R*R+R�trun_insertstrun_deletesR4R]R,R=R�R;R�R9RR5tschema_reflectionR�R�R�R�t!foreign_key_constraint_reflectionRzR�R6R�R�R�R8RHR�R�R�R�R�R�R�R
RvRt!primary_key_constraint_reflectionR�R�R�RR'R�R�R�R.R�R3ttemp_table_reflect_indexesR:R�R�tonly_onR\ttable_reflectionRb(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��s�
�$	.				A
		%	"	*		U	-	
tTableNoColumnsTestcBs�eZdZeZejd��Zejd��Zej	j
d��Zej	j
d��Zej	j
d��Z
ej	jej	j
d���Zej	jej	j
d���ZRS(	treflect_tables_no_columnscCstd|�|j|�dS(Ntempty(R	t
create_all(RPRVR<((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttable_no_columns�s
cCsjtd|�|j|�td|�tj|dtd��tj|dtd��|j|�dS(NRmR>s*CREATE VIEW empty_v AS SELECT * FROM emptyR?sDROP VIEW IF EXISTS empty_v(R	RnR
R@R(RPRVR<((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pytview_no_columns�s



cCs2tdt�d|�}tt|j�g�dS(NRmR*(R	RRR+Rc(RPRVRott2((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_reflect_table_no_columns�scCs tt|�jd�g�dS(NRm(RRR�(RPRVRo((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt!test_get_columns_table_no_columns�scCs;t�}|j|�t|j�jdg�s7t�dS(NRm(RtreflectR�R�R�Rg(RPRVRotm((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt"test_reflect_incl_table_no_columns�s	
cCs2tdt�d|�}tt|j�g�dS(Ntempty_vR*(R	RRR+Rc(RPRVRpRq((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_reflect_view_no_columns�scCs tt|�jd�g�dS(NRw(RRR�(RPRVRp((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt test_get_columns_view_no_columns�s(Rl(R*R+t__requires__R4R]RtfixtureRoRpR5RlRrRsRvR_RxRy(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRk�s		tComponentReflectionTestExtrac
BsUeZeZejeejjfefdd�ejj	d���Z
ejjd��Zejj
d��Zd�Zejjd��Zejjd��Zejjd��Zejdd	dejjfddd
ejjfiddejjfiddejjfdddejjfdddejjfdd
�d��ZRS(R�R�c		Cs|rtj}nd}td|tdt��tjddd�tjddd�d|�|j|�t	|�}t
|jdd|�d	tj
d��}d
�}g|D](}i|dd6||d�d6^q�}t|idd6dd6idd6d
d6g�dS(Ntsa_ccR<sa > 1 AND a < 5RDtcc1sa = 1 OR (a > 2 AND a < 5)t
UsesCasingR3R&cSs%djtjd|j�tj��S(Nt sand|\d|=|a|or|<|>(tjointretfindalltlowertI(tsqltext((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt	normalize�sR�sa = 1 or a > 2 and a < 5sa > 1 and a < 5(RR7R�R	RRRERtRnRR�R�RCRDR(	RPR<RVR�R3RLR1R�titem((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��s.
	2cCs!td|tdtd��tdtd���}tdtj|jj�tj|jj��td|jj�|j	|�t
|�}idd6dgd6td	6id
6g}tj
jjr�g|dd<igd
|jj6|dd
<ntd��t|jd�|�WdQXdS(NR�txitytt_idxtt_idx_2RDR)R(R4iR5s
%s_includes>Skipped unsupported reflection of expression-based index t_idx(R	RRRRR�RcR�R�RnRR�RR5R6R"R�RDRRR�(RPR<RVR�RWR8((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt%test_reflect_expression_based_indexess*.



cCstd|tdtd��tdtd���}td|jj�}dg|j|jjd<|j	|�t
|�}t|jd�idd6dgd6dgd	6t
d
6idgd|jj6d6g�tdt�d
|�}tt|j�dj|jjddg�dS(NR�R�iR�R�tincludeRDR)R5R(s
%s_includeR4R*i(R	RRRRcR�R4R�RDRnRRR�R�RR+R!(RPR<RVR�R9RWRq((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_reflect_covering_index3s.


cGsutd|gt|�D]\}}td||�^q�}|j|�gt|�jd�D]}|d^qaS(NR�st%dR�(R	R�RRFRR�(RPRVR<RRttype_R�Rc((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_type_round_tripYs5
cCshxa|j||tjdd��D]>}t|tj�s@t�t|jd�t|jd�q"WdS(Nii(R�R�R�R�RgRt	precisiontscale(RPRVR<ttyp((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_numeric_reflectioncs
	cCsN|j||tjd��d}t|tj�s:t�t|jd�dS(Ni4i(R�R�RR�RgRtlength(RPRVR<R�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_varchar_reflectionls
c	Cs~td|tdtdt�tdtdt��}|j|�ttd�t|�j	d�D��itd6td6�dS(NR�R<R�R>css#|]}|d|dfVqdS(RDR�N((R]R((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys	<genexpr>s(
R	RRR4R�RFRR%RR�(RPRVR<R�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_nullable_reflectionts
tCASCADEsSET NULLs	NO ACTIONtRESTRICTsexpected,ondelete,onupdatecs�i}|r||d<n|r,||d<n|dkrA|}ntd|tdtdt�dt�td|tdtdt�tdttjd	d
d��tdtd
��dt�td|tdtdt�td
td�dt�tdt�tj	dgdgd
d|�dt�|j
|�t|�}|jd�dd�t
t�fd��D��i�|jd�dd�t
�|�dS(NtondeletetonupdateR�R/R0RoRtx_idsx.idRDtxidttesti
tuseri2R�ttidstable.idtmyfkiRc3s)|]}�|r|�|fVqdS(N((R]tk(topts(sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys	<genexpr>�s(R�R	RRR4RERRR�RsRnRR�RR%(RPRVR<R8R�R�RRW((R�sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_foreign_key_options�sD*

	
#N(R*R+R4R]RRzR5R6R�R�R�tindexes_with_expressionsR�R6R�R�RjR�R�R�R�t1foreign_key_constraint_option_reflection_ondeletet1foreign_key_constraint_option_reflection_onupdatet1fk_constraint_option_reflection_ondelete_noactiont1fk_constraint_option_reflection_onupdate_restrictt1fk_constraint_option_reflection_ondelete_restrictR�(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR|�sH.%&	
	tNormalizedNameTestcBs5eZdZeZed��Zd�Zd�ZRS(tdenormalized_namescCslttddt�|tdtdt��ttddt�|tdtdt�tdtd���dS(Ntt1RxR/R0Rqtt1idst1.id(R	RR4RRR(R(R<((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR=�scCs�t�}ttddt�|dtj�}|jd}|jjj	|jj
�s[t�t�}|jtjdd��|jdjjj	|jdjj
�s�t�dS(NRqRxR*R�tonlycSs|j�dkS(NR�Rq(R�Rq(R�(RDRu((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt<lambda>R�(
RR	RR4RR'R�RcR�t
referencesR/RgRt(RPtm2tt2_reftt1_reftm3((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt$test_reflect_lowercase_forced_tables�s	!
!	cCs�gttj�j�D]}|j�dkr|^q}t|dj�|dj��t|dj�|dj��dS(NR�Rqii(R�Rq(RRR'R�R�Rtupper(RPR�t
tablenames((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�s
!(R�(	R*R+RzR4R]R,R=R�R�(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��s
	tComputedReflectionTestcBsAeZd�Zd�Zd�Zd�Zejjd��Z	RS(cCstttj�}|jd�}d�|D�}td|ddk�t|ddd�t|ddd�dS(Ntcomputed_default_tablecSsi|]}||d�qS(RD((R]Rc((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys
<dictcomp>s	t42twith_defaultR�tnormaltcomputed_col(RRR'R�RRR�(RPRWRtcol_data((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt!test_computed_col_default_not_setscCs�ttj�}|jd�}d�|D�}x"dD]}td||k�q5W|d}td|k�td|dk�t|j|dd�d	�td
|dktjj	j
�tjj	j
r�t|dd
tjjj
�ndS(NR�cSsi|]}||d�qS(RD((R]Rc((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys
<dictcomp>s	R/R�R�tcomputedR�R�s	normal+42t	persisted(R/R�R�(RRR'R�RRR�RR5t"computed_columns_reflect_persistedR"t"computed_columns_default_persisted(RPRWRR1R&tcompData((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt test_get_column_returns_computeds 


cCsstd||k�||d}t|j|d�|�tjjjrotd|k�t|d|�ndS(NR�R�R�(RRR�RR5R�R"R(RPR1tcolumnR�R�R�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pytcheck_column.scCs�ttj�}|jd�}d�|D�}|j|ddtjjj�tjj	jru|j|ddt
�ntjjjr�|j|ddt�ndS(	Ntcomputed_column_tablecSsi|]}||d�qS(RD((R]Rc((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys
<dictcomp>:s	tcomputed_no_flags	normal+42tcomputed_virtualsnormal+2tcomputed_storeds	normal-42(
RRR'R�R�RR5R�R"tcomputed_columns_virtualR�tcomputed_columns_storedR4(RPRWRR1((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt!test_get_column_returns_persisted6s(
cCs�ttj�}|jddtj�}d�|D�}|j|ddtjjj	�tjj
j	r~|j|ddt�ntjjj	r�|j|dd	t
�ndS(
NR�R3cSsi|]}||d�qS(RD((R]Rc((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys
<dictcomp>Xs	R�s	normal/42R�snormal/2R�s	normal*42(RRR'R�R7R�RR5R�R"R�R�R�R4(RPRWRR1((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt-test_get_column_returns_persisted_with_schemaQs*
(
R*R+R�R�R�R�RR5R6R�(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�s
					tIdentityReflectionTestcBsTeZdZZeZdZed��Z	d�Z
d�Zej
jd��ZRS(tidentity_columnsRjcCs�td|tdt�tdtt���td|tdttdtddd	d
ddd
ddtdd���tjjjr�td|tdt�tdttdtdd��dt	j
�ndS(NR�R�tid1Rqtid2talwayststartit	incrementitminvaluei����tmaxvaluei*tcycletcacheiiR3(R	RRR
R4RR5R6R"RR7(R(R<((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR=vs4
!cCs%tjjjr�d}x0t|�D]"}||kr"|j|�q"q"W|r�tt|�t|��x�|D]r}|dkr�t||||k�qn|ddhkr�t||||k�qnt|||||�qnWq!t||�n*t|d|d�t|d|d�dS(	NR�R�R�R�R�R�R�(R�R�R�R�R�R�R�(	RR5tidentity_columns_standardR"R+R0RR�R(RPtvaluetexptapproxtcommon_keysR�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pytcheck�s,
cCs�ttj�}|jd�|jd�}x[|D]S}|ddkr[td|k�q2|ddkr�t|dtdfk�t|d	d�td|k�|j	|dt
d
tddd
ddddddtdd�dt�q2|ddkr2t|dtdfk�t|d	d�td|k�|j	|dt
d
tddd
ddddddtdd�dt�q2q2WdS(NR�RqRDR�tidentityR�R^tautoR�R�R�iR�R�R�i���R�R�R�R�iii����i*i(RRR'R�RRR4RR�R�R%R�(RPRWRR((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_reflect_identity�sF
	
	cCs�ttj�}|jddtj�}x�|D]�}|ddkrWtd|k�q.|ddkr.t|dtdfk�t|d	d�td|k�|j
|dtd
tddd
ddddddtdd�dt�q.q.WdS(NR�R3RDR�R�R�R^R�R�R�R�iR�iR�R�i���R�R�R�(
RRR'R�R7RRR4RR�R�R%R�(RPRWRR((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_reflect_identity_schema�s(
	N(R�Rj(R*R+R�RcRdR4R]RzR,R=R�R�RR5R6R�(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�ps
"		*tCompositeKeyReflectionTestcBsGeZeZed��Zejjd��Z	ejj
d��ZRS(cCs�td|tdt�tdt�tdtjd��tjddddd�dddt�}td	|tdtd
t�tdt�tdt�td
tjd��tj	d
ddg|j
j|j
j|j
j
gdd�dddt�dS(Nttb1R/tattrRDitpk_tb1R3Rottb2R0tpidtpattrtpnametfk_tb1_name_id_attr(R	RRR�RGRERqR�R4RsRcRDR/R�(R(R<R�((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR=�s,	!	cCsJt|j�}|j|jjj�}t|jd�dddg�dS(NRRDR/R�(RR�R�R�R�RDRR_(RPRWR0((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_pk_column_orderscCs�t|j�}|j|jjj�}tt|�d�|d}t|jd�dddg�t|jd�dd	d
g�dS(NiiRRDR/R�RR�R�R�(	RR�R�R�R�RDRR�R_(RPRWtforeign_keysR((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_fk_column_order s
(R*R+R4R]R,R=RR5RgR�RfR�(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR��s(6RCR�R#RER�RRRRRRt	provisionRRR3RR	R
RRR
RRRRRRR�RRtsql.elementsRt
sql.schemaRRRR�R<R�t
TablesTestRR-R`RkR�tTestBaseRkR|R�tComputedReflectionFixtureTestR�R�R�t__all__(((sY/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt<module>sl�;����7�,a�2