%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyc

�
��4]c@s�ddlZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lm
Z
ddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZe e f\Z!Z"de
j#fd��YZ$de
j#fd��YZ%de
j#fd��YZ&dddfZ'dS( i����Ni(tassert_raises_message(tconfig(tengines(teq_(texpect_warnings(tfixtures(tis_(tColumn(tTablei(tevent(texc(t
ForeignKey(tinspect(tInteger(tMetaData(tString(ttesting(ttypes(t	Inspector(tDDL(tIndex(tquoted_nametHasTableTestcBs&eZeZed��Zd�ZRS(cCs5td|tdtdt�tdtd���dS(Nt
test_tabletidtprimary_keytdatai2(RRR
tTrueR(tclstmetadata((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt
define_tables#s
cCsYtjj��D}tjjj|d�s0t�tjjj|d�sOt�WdQXdS(NRtnonexistent_table(Rtdbtbegintdialectt	has_tabletAssertionError(tselftconn((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_has_table,s(t__name__t
__module__Rt__backend__tclassmethodRR'(((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR s	tComponentReflectionTestcBsZeZdEZZeZed��Zed��Z	ed��Z
ed��Zed��Zed��Z
ejjd��Zejjd��Zejjd��ZejdEd	dEd
��Zejjd��Zejjejjejjd����Zejjd
��Zejjejjd���Zejjd��Z ejjejj!d���Z"dEd�Z#ejjejj!d���Z$ejj%d��Z&ejj%ejj!d���Z'ejjejj%d���Z(dEd	d�Z)ejjd��Z*ejd��Z+ejjd��Z,ejjd��Z-ejjejd���Z.ejjejj!d���Z/ejj0d��Z1ejj0ejj%ejjd����Z2ejj%d��Z3ejj%ejj!d ���Z4ejdEd!��Z5ejj6d"��Z7ejjejj6ejj!d#����Z8ejjejd$���Z9ejdEd%��Z:ejjd&��Z;ejjejj!d'���Z<ejj=ejj!d(���Z>ejj?d)��Z@ejjAd*��ZBejd+��ZCd,�ZDejdEd-��ZEejjFd.��ZGejjFejj!d/���ZHejd0��ZIejjFd1��ZJejjFd2��ZKejjLejd3���ZMejjNd4��ZOejj0ejjNd5���ZPejj0d6��ZQejjNejj!d7���ZRejdEd8��ZSejjTd9��ZUejjTejj!d:���ZVejdEd;��ZWejdEd<��ZXejjd=��ZYejjejj!d>���ZZej[d?d@�ejdEdA���Z\dB�Z]ejj!dC��Z^ejjejdD���Z_RS(FcCsFtjjjr;ddlm}tjdtd|j	��Stj
SdS(Ni����(tpooltoptionst	poolclass(Rtrequirementstindependent_connectionstenabledt
sqlalchemyR-Rttesting_enginetdictt
StaticPoolR (RR-((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt
setup_bind7s
	cCs<|j|d�tjjjr8|j|tjj�ndS(N(tdefine_reflected_tablestNoneRtrequirestschemasR2Rttest_schema(RR((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRBsc
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�ntjjjrL|j||�|sLtd*|td+tjd��dt�}td,|tdtjdt�td+tjd��dt�}td-|jjj��td.|jjj��qLntjjjrn|j||�n|r�tjj jr�|j!|�ndS(/Nt.ttuserstuser_idRttest1itnullablettest2tparent_user_ids%susers.user_idtnamet
user_id_fktschemat
test_needs_fkt
dingalingstdingaling_idt
address_ids%semail_addresses.address_idRitemail_addressestremote_user_idt
email_addressitemail_ad_pktcomment_testRtcomments
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("RR:tself_referential_foreign_keysR2RRtsatINTRtCHARtFalsetFloatR
RRtcR@tPrimaryKeyConstrainttcross_schema_fk_reflectionR9RR<R R"tdefault_schema_nametindex_reflectiontdefine_indexRRYtdesctview_column_reflectiontdefine_viewsttemp_table_reflectiontdefine_temp_tables(RRRGt
schema_prefixR?RXRZ((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR8Hs�
		
		c
Cs�tjd�r)idgd6dd6}nidgd6}td|tdtjd	t�td
tjd��tdtj�tjd
d
d
�tj	dd�|�}tj
jjr�tj
j
jr�tj|dtd��tj|dtd��ndS(NtoraclesGLOBAL TEMPORARYtprefixess
PRESERVE ROWStoracle_on_committ	TEMPORARYtuser_tmpRRREi2tfootuser_tmp_uqtuser_tmp_ixtafter_creates:create temporary view user_tmp_v as select * from user_tmptbefore_dropsdrop view user_tmp_v(RtagainstRRR^R_RtVARCHARtUniqueConstraintRR:tview_reflectionR2ttemporary_viewsR	tlistenR(RRtkwRs((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRm�s,

	
cCsEtd|jj|jj�td|jj|jj|jj�dS(Ntusers_t_idxt
users_all_idx(RRcRARCR@(RRR?((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRh�scCs�x}d	D]u}|}|r,d||f}n|d}d||f}tj|dt|��tj|dtd|��qWdS(
NR?RLs%s.%st_vs"CREATE VIEW %s AS SELECT * FROM %sRwRxsDROP VIEW %s(R?RL(R	R~R(RRRGt
table_nametfullnamet	view_nametquery((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRk�s


cCs2ttj�}|jtjj|j�k�dS(N(RRR tassert_RR<tget_schema_names(R%tinsp((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_schema_namesscCsKtj�}t|jd�s%t�t|�t|jd�sGt�dS(NRf(RR4thasattrR"R$R(R%tengine((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_dialect_initializes
cCs,ttj�}t|jtjjj�dS(N(RRR RRfR"(R%R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_default_schema_namesttablecCs5ddddddg}|j}t|j�}|dkrw|j|�}|j�dd	g}tt|�|�n�|r�g|j|�D]}	|	d
r�|	d
^q�}
n|j|�}
g|
D]}||kr�|^q�}|dkrdd
dg}t||�n"dd
dg}tt|�|�dS(NRPRZRXRSRURWtviewtemail_addresses_vtusers_vitforeign_keyR?RLRI(	RRtbindtget_view_namestsortRtsortedtget_sorted_table_and_fkc_namestget_table_names(R%RGt
table_typetorder_byt_ignore_tablestmetaR�ttable_namestanswertrecttablestt((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_table_names"s0		
%cCs5t|j�}|j�}tt|�dg�dS(NRs(RR�tget_temp_table_namesRR�(R%R�ttemp_table_names((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_table_namesIscCs5t|j�}|j�}tt|�dg�dS(Nt
user_tmp_v(RR�tget_temp_view_namesRR�(R%R�R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_view_namesOscCs|j�dS(N(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_namesWscCs|jdd�dS(NR�R�(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_names_fks[scCs|j�dS(N(t_test_get_comments(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_comments`scCs|jtjj�dS(N(R�RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_comments_with_schemadscCs�ttj�}t|jdd|�idd6�t|jdd|�idd6�tg|jdd|�D]"}i|dd6|dd6^qnidd6d	d6id
d6dd6idd6d
d6g�dS(NRPRGsthe test % ' " \ table commentttextR?RERQs
id commentRsdata % commentRs)Comment types type speedily ' " \ '' Fun!RR(RRR Rtget_table_commentR9tget_columns(R%RGR�R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�is#8cCs|jtjj�dS(N(R�RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt test_get_table_names_with_schema�scCs|jdd�dS(NR�R�(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_view_names�scCs|jtjjdd�dS(NR�R�(R�RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_view_names_with_schema�scCs|j�|jdd�dS(NR�R�(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_tables_and_views�s
cCsttj�}|jj|jj}}ddg}|dkrOddg}nt|j�}x�t|||f�D]�\}}	|}
|j	|d|
�}|j
t|�dkt|��xKt|	j
�D]:\}}
t|
j||d�||d	j}|
j}t|tjj�r,|j}ntjd
�r_|tjtjfkr_tj}n|j
tt|j�j|j�jtjtjtjtjtjtj tj!g��dkd|
j|
j||d|f�|
j"s�||ddkst$�q�q�WqtWdS(
NR?RLR�R�R�RGiREttypeRos%s(%s), %s(%s)tdefault(%RRR R�R?RLRR�tzipR�R�tlent	enumeratetcolumnsRREt	__class__R�t
isinstanceR^Rt
TypeEngineRyt	sql_typestDatetDateTimetsett__mro__tintersectionR
tNumerictTimeRt_BinaryRR9R$(R%RGR�R�R?t	addressesR�R�R�R�tschema_nametcolstitcoltctypet	ctype_def((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_columns�sH""	"	cCs|j�dS(N(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_columns�scGs{td|jgt|�D]\}}td||�^q�}|j�gt|jj�jd�D]}|d^qgS(NR�st%dR�(RRR�RtcreateRR�R�(R%RR�ttype_R�Rc((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_type_round_trip�s5
cCsbx[|jtjdd��D]>}t|tj�s:t�t|jd�t|jd�qWdS(Nii(R�R�R�R�R$Rt	precisiontscale(R%ttyp((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_numeric_reflection�s"cCsH|jtjd��d}t|tj�s4t�t|jd�dS(Ni4i(R�R�RR�R$Rtlength(R%R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_varchar_reflection�sc	Cs�td|jtdtdt�tdtdt��}|j�ttd�t	|jj
�jd�D��itd6td6�dS(NR�taRBtbcss#|]}|d|dfVqdS(RERBN((t.0R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys	<genexpr>�s(RRRR
RRaR�RR5RR�R�(R%R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_nullable_reflection�s
cCs|jdtjj�dS(NRG(R�RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_columns_with_schemascCs�t|j�}|jj}t|j�}|jd�}|jt|�dkt|��x5t|j	�D]$\}}t
|j||d�qkWdS(NRsiRE(RR�R�RsRR�R�R�R�R�RRE(R%R�RsR�R�R�R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_table_columnss"cCsOt|j�}|jd�}tg|D]}|d^q(dddg�dS(NR�RERRt(RR�R�R(R%R�R�R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_view_columnsscCs|jdd�dS(NR�R�(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_view_columnsscCs |jdtjjdd�dS(NRGR�R�(R�RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt!test_get_view_columns_with_schemas	c
Cs�|j}|jj|jj}}t|j�}|j|jd|�}|d}t|dg�|j|jd|�}|d}	t|	dg�t	j
jj��t|dd�WdQXdS(NRGtconstrained_columnsR@RKRERO(
RR�R?RLRR�tget_pk_constraintRERRR:treflects_pk_namestfail_if(
R%RGR�R?R�R�t
users_constusers_pkeyst	addr_const
addr_pkeys((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_pk_constraint%s	

cCs|j�dS(N(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_pk_constraint6scCs|jdtjj�dS(NRG(R�RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt"test_get_pk_constraint_with_schema:scCsD|j}|jj}t|j�}ttjd|j|j	�dS(Ns+.*get_primary_keys\(\) method is deprecated(
RR�R?RR�Rtsa_exctSADeprecationWarningtget_primary_keysRE(R%R�R?R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt test_deprecated_get_primary_keys@s	c
Cs�|j}|jj|jj}}t|j�}|}tjjj	r�|j
|jd|�}|d}tjjj
��t|dd�WdQXt|d|�t|d|j�t|ddg�tjjj	r�t|d	d
g�q�n|j
|jd|�}	|	d}tjjj
��|j|ddk	�WdQXt|d|�t|d|j�t|ddg�t|d	dg�dS(NRGiRERFtreferred_schematreferred_tabletreferred_columnsR@R�RDRM(RR�R?RLRR�RR:R]R2tget_foreign_keysREtnamed_constraintsR�Rtimplicitly_named_constraintsR�R9(
R%RGR�R?R�R�texpected_schematusers_fkeystfkey1t
addr_fkeys((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_foreign_keysMs,	

cCs|j�dS(N(R�(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_foreign_keysnscCs|jdtjj�dS(NRG(R�RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt!test_get_foreign_keys_with_schemarsc	Csp|jdtjjjdtjjdtjj�\}}}ttj�}|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}|ddtjjjfks0t
�t
|d|j	�t
|dd	g�t
|d
d
g�dS(Ns%s.local_tables%s.remote_tables%s.remote_table_2iiR�R�R�RR�RTRGRV(R�RR R"RfRR<RR�RERR�R9R$(	R%RSRURWR�tlocal_fkeysR�tremote_fkeystfkey2((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt"test_get_inter_schema_foreign_keysws,


cCs|jdd�dS(NtondeletetCASCADE(t_test_get_foreign_key_options(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt%test_get_foreign_key_options_ondelete�scCs|jdd�dS(NtonupdatesSET NULL(R(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt%test_get_foreign_key_options_onupdate�scs{|j}td|tdtdt�dt�td|tdtdt�tdttjddd	��td
td��dt�td|tdtdt�tdtd
�dt�tdt�tj	dgdgdd|�dt�|j
�t|j�}|j
d�dd�tt�fd��D��i�|j
d�dd�tt�fd��D��|�dS(NtxRRRHR�tx_idsx.idREtxidttesti
tuseri2RBttidstable.idtmyfkiR.c3s)|]}�|r|�|fVqdS(N((R�tk(topts(s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys	<genexpr>�sc3s)|]}�|r|�|fVqdS(N((R�R(R(s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys	<genexpr>�s(RRRR
RR^RRRatForeignKeyConstraintt
create_allRR�R�RR5(R%R.R�R�((Rs[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�s8	
#cCs�g|D]}|d^q}xa|D]Y}|d|ks@t�||j|d�}x#|D]}t||||�q^Wq$WdS(NRE(R$tindexR(R%tindexestexpected_indexestdtindex_nameste_indexRtkey((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_assert_insp_indexes�s

cCs�|j}t|j�}|jdd|�}itd6ddgd6dd6itd6d	ddgd6d
d6g}|j||�dS(NR?RGtuniqueRARCtcolumn_namesR�RER@R�(RRR�tget_indexesRaR(R%RGR�R�RR((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_indexes�s	

cCs|j�dS(N(R(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_indexes�scCs|jdtjj�dS(NRG(RRRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_indexes_with_schema�scCs�|j}t|j�}|j|�}itd6|d6g}|j||�t||d|j�}tt|j	�d�t
t|j	�dj|�tt|j	�dj
|�dS(NRREt
autoload_withii(RRR�RRaRRRR�RRtlistR�RE(R%ttnametixnameR�R�RRR�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_noncol_index�s	cCs|jdd�dS(NRXR[(R&(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_noncol_index_no_pkscCs|jdd�dS(NRZR\(R&(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_noncol_index_pksc	Cs�td|jtdtd��tdtd���tj|jdtd��tj|jdtd��|jj�t|jj	�}t
d��6t|jd�id	d
6dgd6dd
6g�WdQXdS(NR�R	ityRws+CREATE INDEX t_idx ON t(lower(x), lower(y))sCREATE INDEX t_idx_2 ON t(x)s>Skipped unsupported reflection of expression-based index t_idxtt_idx_2RERiR(
RRRRR	R~RRRR�RRR(R%R�((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt%test_reflect_expression_based_indexess$


cCs|j�dS(N(t_test_get_unique_constraints(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_unique_constraints,scCsdt|j�}|jd�}x|D]}|jdd�q%Wt|idgd6dd6g�dS(NRstduplicates_indexRERRu(RR�tget_unique_constraintstpopR9R(R%R�t	reflectedtrefl((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt&test_get_temp_table_unique_constraints0s

cCs�t|j�}|jd�}x|D]}|jdd�q%Wtg|D]}|ddkrI|^qIitd6dgd6dd6g�dS(NRstdialect_optionsRERvRRtR(RR�RR0R9RRa(R%R�Rtindtidx((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_temp_table_indexes;s
&
cCs|jdtjj�dS(NRG(R,RRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt'test_get_unique_constraints_with_schemaNscCs�tidd6dgd6idd6dddgd6idd6dddgd6id	d6d
dgd6idd6dgd6id
d6dgd6gdtjd��}|j}td|tdtjd��tdtjd��tdtj�td
tjd��tdtjd��d|�}x2|D]*}|j	tj
d|d|d��q*W|j�t|j
�}t|jdd|�dtjd��}t�}xRt||�D]A\}	}
|
jdd�}|r�|j|�nt|	|
�q�Wt�}td|d|j
d|�}tg|jD]}
|
j^q-�}tg|jD]!}t|tj
�rR|j^qR�jdg�}|j|�s�t�|r�t||�t|t��ndS(Ntunique_aRER�Rtunique_a_b_cR�Rctunique_c_a_btunique_asc_keytascRsi.have.dotss
i have spacesttesttbliiRGR.R"(R�toperatort
itemgetterRRRR^RR
tappend_constraintR{RRR�R/R�R�R0R9taddRRRREtconstraintsR�t
differenceR�R$(R%RGtuniquest	orig_metaR�tuct	inspectorR1tnames_that_duplicate_indextorigR2tdupetreflected_metadataR6t	idx_namestuqtuq_names((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR,Ss`		
"
				%
$
cCs|j�dS(N(t_test_get_check_constraints(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_check_constraints�scCs|jdtjj�dS(NRG(RPRRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt!test_get_check_constraints_schema�sc	Cs|j}td|tdt��tjddd�tjddd�d|�|j�t|j�}t	|j
dd|�d	tjd��}d
�}g|D](}i|dd6||d�d6^q�}t
|idd6dd6idd6d
d6g�dS(Ntsa_ccR�sa > 1 AND a < 5REtcc1sa = 1 OR (a > 2 AND a < 5)tcc2RGRcSs%djtjd|j�tj��S(Nt sand|\d|=|a|or|<|>(tjointretfindalltlowertI(tsqltext((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt	normalize�sR\sa > 1 and a < 5sa = 1 or a > 2 and a < 5(RRRR
R^tCheckConstraintRRR�R�tget_check_constraintsR?R@R(R%RGRFRHR1R]titem((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRP�s(	
	2cCsl|j}d}d}t|j�}|j|d|�}|j|�|j|d|�}|j|�dS(NR�R�RG(RRR�tget_view_definitionR�(R%RGR�t
view_name1t
view_name2R�tv1tv2((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_view_definition�s	
cCs|j�dS(N(Rf(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_view_definition�scCs|jdtjj�dS(NRG(RfRRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt$test_get_view_definition_with_schema�st
postgresqlsPG specific featurecCsD|j}t|j�}|j||�}|jt|t��dS(N(RRR�t
get_table_oidR�R�tint(R%R�RGR�R�toid((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt_test_get_table_oid�s	cCs|jd�dS(NR?(Rm(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_oid�scCs|jddtjj�dS(NR?RG(RmRRR<(R%((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_get_table_oid_with_schema�scCsw|j}t|j�}xXd
ddgD]G\}}|j|�}d�|D�|}|jdt�s(t�q(Wd	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@RLRKRIRJcSsi|]}||d�qS(RE((R�Rc((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pys
<dictcomp>s	t
autoincrementN(R?R@(RLRK(RIRJ(RRR�R�tgetRR$(R%R�R�R$tcnameR�tid_((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyttest_autoincrement_col�s	N(`R(R)R9trun_insertstrun_deletesRR*R+R7RR8RmRhRkRR:tschema_reflectionR�R�R�tprovide_metadataR�R�R�R|R}R�ttable_reflectionR�t!foreign_key_constraint_reflectionR�tcomment_reflectionR�R;R�R�R�RjR�R�R�R�R�R�R�R�R�R�RlR�R�R�R�R�t!primary_key_constraint_reflectionR�R�R�R�R�R�ReRt1foreign_key_constraint_option_reflection_ondeleteRt1foreign_key_constraint_option_reflection_onupdateRRRRRgR R!R&R'R(tindexes_with_expressionsR+tunique_constraint_reflectionR-R3R7R8R,tcheck_constraint_reflectionRQRRRPRfRgRhtonly_onRmRnRoRt(((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR,2s�
�$%							8
								 		"-				
	N	'
			tNormalizedNameTestcBs5eZdZeZed��Zd�Zd�ZRS(tdenormalized_namescCslttddt�|tdtdt��ttddt�|tdtdt�tdtd���dS(Ntt1tquoteRRtt2tt1idst1.id(RRRRR
R(RR((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyRscCs�ttj�}ttddt�|dt�}|jd}|jjj	|jj
�s^t�ttj�}|jdd��|jdjjj	|jdjj
�s�t�dS(NR�R�tautoloadR�tonlycSs|j�dkS(NR�R�(R�R�(RZ(REtm((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt<lambda>,R>(
RRR RRRR�RcR�t
referencesRR$treflect(R%tm2tt2_reftt1_reftm3((s[/opt/alt/python27/lib64/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�R�ii(R�R�(RRR R�RZRtupper(R%R�t
tablenames((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�/s
!(R�(	R(R)t__requires__RR*R+RR�R�(((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyR�s
	((R?RXR3R^R>RRRRRRRRGRRR	R
R�RRR
RRRRR�tengine.reflectionRRRtsql.elementsRR9RR?t
TablesTestRR,R�t__all__(((s[/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/test_reflection.pyt<module>s@����(

Zerion Mini Shell 1.0