ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 4]c@@sddlmZddlZddlZddlZddlmZddlmZddlmZddlm Z ddl m Z dd l m Z d d lmZd d lmZd d lmZd dlmZd dlmZd dlm Z d dlmZd dlmZd dl mZd dl mZdZejdZdZdZdZdZ eje!e!e"dZ#dZ$da%dZ&ddZ(ddZ)ddZ*dd Z+dd!Z,dd"Z-dd#Z.dd$Z/dd%Z0dd&Z1dd'Z2dd(Z3d)Z4d*Z5d+e6fd,YZ7d-e6fd.YZ8d/e6fd0YZ9dS(1i(tabsolute_importNi(t assertsql(tconfig(tmock(tutil(tdb_spec(tfaili(texc(torm(tpool(tschema(ttypes(tdefault(turl(tcompat(t decoratorcO@sttj||S(sContext manager which expects one or more warnings. With no arguments, squelches all SAWarnings emitted via sqlalchemy.util.warn and sqlalchemy.util.warn_limited. Otherwise pass string expressions that will match selected warnings via regex; all non-matching warnings are sent through. The expect version **asserts** that the warnings were in fact seen. Note that the test suite sets SAWarning warnings to raise exceptions. (t_expect_warningstsa_exct SAWarning(tmessagestkw((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytexpect_warnings s co@sUt|}t|tjr6|tj r6dVnt|| dVWdQXdS(sContext manager which expects one or more warnings on specific dialects. The expect version **asserts** that the warnings were in fact seen. N(Rt isinstanceRt string_typesRt_currentR(tdbRRtspec((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytexpect_warnings_on0s  "c@stfd}|S(sDecorator form of expect_warnings(). Note that emits_warning does **not** assert that the warnings were in fact seen. c@s*tdt|||SWdQXdS(Ntassert_(RtFalse(tfntargsR(R(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytdecorateIs(R(RR ((RsP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyt emits_warningAscO@sttj||S(N(RRtSADeprecationWarning(RR((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytexpect_deprecatedQsc@stfd}|S(sVMark a test as emitting a warning on a specific dialect. With no arguments, squelches all SAWarning failures. Or pass one or more strings; these will be matched to the root of the warning description by warnings.filterwarnings(). Note that emits_warning_on does **not** assert that the warnings were in fact seen. c@s-tdt|||SWdQXdS(NR(RR(RRR(RR(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyR as(R(RRR ((RRsP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytemits_warning_onUs c@stfd}|S(s+Mark a test as immune from fatal deprecation warnings. With no arguments, squelches all SADeprecationWarning failures. Or pass one or more strings; these will be matched to the root of the warning description by warnings.filterwarnings(). As a special case, you may pass a function name prefixed with // and it will be re-written as needed to match the standard warning verbiage emitted by the sqlalchemy.util.deprecated decorator. Note that uses_deprecated does **not** assert that the warnings were in fact seen. c@s*tdt|||SWdQXdS(NR(R#R(RRR(R(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyR ys(R(RR ((RsP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytuses_deprecatedisc#@sr8g|D]"}tj|tjtjB^q n|ttjfd}tjd| dVWdQX|r| st j r st ddj fdDndS(Nc@st|r$|}t|}n|r7|d}nd}| sTt| rd|||SsndSxWD]?}r|j|s ru||kruj|PququW|||dS(Ni(RtstrtNonet issubclasstmatchtdiscard(tmsgtargRt exceptiontfilter_(texc_clstfilterst real_warntregextseen(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytour_warns    s warnings.warnsWarnings were not seen: %ss, c3@s(|]}dr|jn|VqdS(s%rN(tpattern(t.0ts(R2(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pys s( tretcompiletItStsettwarningstwarnRtpatchRtpy3ktAssertionErrortjoin(R/RR2Rtpy2konlyR+R4((R/R0R1R2R3sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRs2   cC@s tdS(sCheck things that have to be finalized at the end of a test suite. Hardcoded at the moment, a modular system can be built here to support things like PG prepared transactions, tables all dropped, etc. N(t!_assert_no_stray_pool_connections(((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytglobal_cleanup_assertionsscC@stjtjr<td7adttjGHtjntjr{ttj}tjjdatj d|n'tdkrt st ddandS(Nis2Encountered a stray connection in test cleanup: %sis8Stray connection refused to leave after gc.collect(): %si s*Encountered more than 10 stray connections( ttestutiltlazy_gcR t_refst_STRAY_CONNECTION_FAILURESR&t gc_collecttclearR=R>RRA(terr((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRDs       cC@s2tj||s.t|p(d||fdS(Ns%r !~ %r(R8R)RA(tatbR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyteq_regexscC@s,||ks(t|p"d||fdS(s.Assert a == b, with repr messaging on failure.s%r != %rN(RA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyteq_scC@s,||ks(t|p"d||fdS(s.Assert a != b, with repr messaging on failure.s%r == %rN(RA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytne_scC@s,||ks(t|p"d||fdS(s.Assert a <= b, with repr messaging on failure.s%r != %rN(RA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytle_scC@st|td|dS(NR+(tis_tTrue(RMR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytis_truescC@st|td|dS(NR+(RSR(RMR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytis_falsescC@s,||ks(t|p"d||fdS(s.Assert a is b, with repr messaging on failure.s %r is not %rN(RA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRSscC@s,||k s(t|p"d||fdS(s2Assert a is not b, with repr messaging on failure.s%r is %rN(RA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytis_not_scC@s,||ks(t|p"d||fdS(s.Assert a in b, with repr messaging on failure.s %r not in %rN(RA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytin_ scC@s,||ks(t|p"d||fdS(s2Assert a in not b, with repr messaging on failure.s %r is in %rN(RA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytnot_in_scC@s/|j|s+t|p%d||fdS(s>Assert a.startswith(fragment), with repr messaging on failure.s%r does not start with %rN(t startswithRA(RMtfragmentR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyt startswith_scC@stjdd|}tjdd|}tjdd|}tjdd|}||ks|t|pvd||fdS(Ns^\s+?|\nts {2,}t s%r != %r(R8tsubRA(RMRNR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyteq_ignore_whitespaces cO@sGy|||t}Wn|k r0t}nX|sCtddS(Ns#Callable did not raise an exception(RRTRA(t except_clst callable_RRtsuccess((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyt assert_raises's     cO@sy#|||ts"tdWna|k r}tj|tj|tjsltd||ftj|jdGHnXdS(Ns#Callable did not raise an exceptions%r !~ %ssutf-8(RRAR8tsearchRt text_typetUNICODEtencode(RaR+RbRtkwargste((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytassert_raises_message2s ' tAssertsCompiledSQLc B@s,eZdddddeeedd ZRS(c C@s|rtj}n| r$d}n|dkrEt|dd}n|dkr`tjj}nc|dkr{tj}nH|dkrtj}n-t|t j rt j |j }ni} i} | r| | dstComparesTablescB@seZedZdZRS(cC@st|jt|jks$txMt|j|jD]6\}}t|j|j||j|jksutt|j|jt|j|j|rd}t|j t |j st||j |j fn|j ||t|j t j r"t|j j |j j ntd|jDd|jD|jr:t|jtjsptq:q:Wt|jt|jkstx0|jD]%}|jj|jdk stqWdS(Ns)Type '%s' doesn't correspond to type '%s'cS@sh|]}|jjqS((tcolumntname(R6tf((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pys s cS@sh|]}|jjqS((RR(R6R((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pys s (tlenRRAtzipRPRt primary_keytnullableRttypetassert_types_basetsqltypestStringtlengtht foreign_keystserver_defaultR t FetchedValuetcolumnsR'(Rttabletreflected_tablet strict_typesRt reflected_cR+((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytassert_tables_equals.$"! $cC@s;|jj|js7td|j|j|jfdS(Ns7On column %r, type '%s' doesn't correspond to type '%s'(Rt_compare_type_affinityRAR(Rtc1tc2((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRs(RRRRR(((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRs !tAssertsExecutionResultscB@sweZdZdZdZdZd dZdZdZ dZ dZ e j d Zd ZRS( cG@s.t|}t|GH|j|||dS(N(R}Rt assert_list(RRtclass_tobjects((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyt assert_results  cC@sl|jt|t|kdd|jx8tdt|D]!}|j|||||qCWdS(Ns/result list is not the same size as test list, s for class i(RRRtranget assert_row(RRRtlist_ti((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRs cC@s|j|j|kdt|x|jD]\}}t|trt|dtr|jt|||d|dq|j |dt|||dq0|jt|||kd|t|||fq0WdS(Nsitem class is not iis'attribute %s value %s does not match %s( Rt __class__RtitemsRRR}RRyR(RRtrowobjtdesctkeytvalue((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRs''c @s:dtfdYtj|}fd|D}xCtjfd|D]&}tdt|jjfqWWt|t|krtdt|t|fntfd}x\|D]T}xK|D]&}|||r|j |PqqWtdjt |fqWt S( sAs assert_result, but the order of objects is not considered. The algorithm is very expensive but not a big deal for the small numbers of rows that the test suite manipulates. t immutabledictcB@seZdZRS(cS@s t|S(N(tid(R((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyt__hash__s(RRR(((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRsc@sh|]}|qS(((R6Rj(R(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pys s c@s t|S(N(R(to(tcls(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytR]s#Unexpected type "%s", expected "%s"s+Unexpected object count "%s", expected "%s"c@sx|jD]w\}}t|trhy(jt|||d|dWqtk rdtSXq t|||kr tSq WtS(Nii(RRRtassert_unordered_resultRyRARRT(tobjRRR(tNOVALUER(sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyt _compare_items" s2Expected %s instance with attributes %s not found.( tdictRt IdentitySettitertools_filterfalseRRRRRtremoveRRT( RRRtexpectedtfoundtwrongRt expected_itemt found_item((RRRRsP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRs.     cC@s,|dkrddlm}ntj|S(Ni(R(R'R]RRt assert_engine(RR((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytsql_execution_asserters cG@s2|j|}|}WdQX|j||S(N(RR(RRRbtrulestasserterR((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytassert_sql_executions c C@sg}xv|D]n}t|tr_tjg|jD]\}}tj||^q5}ntj|}|j|q W|j|||S(N(RRRtAllOfRt CompiledSQLtappendR( RRRbRtnewrulestruletktvtnewrule((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyt assert_sql#s 7cC@s |j||tj|dS(N(RRtCountStatements(RRRbtcount((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytassert_sql_count1sc C@sgt||D]$\}}|j|||f^q}g}x*|D]"\}}}|j|jqGWz |SWdxOt||D]>\} \}}}|jddd| jtj|qWXdS(N( RRRt __enter__t__exit__R'RRR( RtdbsRbtcountsRRtrecst asserterstctxR((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytassert_multiple_sql_count6s7 %cg@s.|j| }dVWdQX|j|dS(N(RR(RRRR((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytassert_executionEs cC@s|j|tj|S(N(RRR(RRR((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pytassert_statement_countKsN(RRRRRRR'RRRRRt contextlibtcontextmanagerRR(((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyRs   8     (:t __future__RRR8R=R]RRRRRFt exclusionsRRRRRR R R RtengineR R RRRRRR!R#R$R%RTRRRERIRDR'RORPRQRRRURVRSRWRXRYR\R`RdRkRRlRR(((sP/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.pyts^        ,  *            W)