%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/alembic/testing/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyc

�
�M!Vc@@s�ddlmZddlZddlmZddlmZddlmZm	Z	ddl
Z
ddlmZddl
mZddlZd	d
lmZejs�dd�Zdd�Zdd
�Zdd�Zd�Zd�Zn.ddlmZmZmZmZmZmZdd�Zdd�ZiZd�Zd�Ze
j d��Z!d�Z"d�Z#e
j e$e$d��Z%dS(i(tabsolute_importNi(tutil(tdefault(t	text_typetpy3k(t	decorator(texci(tmockcC@s,||ks(t|p"d||f��dS(s.Assert a == b, with repr messaging on failure.s%r != %rN(tAssertionError(tatbtmsg((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyteq_scC@s,||ks(t|p"d||f��dS(s.Assert a != b, with repr messaging on failure.s%r == %rN(R(R	R
R((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytne_scC@s,||ks(t|p"d||f��dS(s.Assert a is b, with repr messaging on failure.s%r is not %rN(R(R	R
R((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytis_scC@s,||k	s(t|p"d||f��dS(s2Assert a is not b, with repr messaging on failure.s%r is %rN(R(R	R
R((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytis_not_scO@sGy|||�t}Wn|k
r0t}nX|sCtd��dS(Ns#Callable did not raise an exception(tFalsetTrueR(t
except_clst	callable_targstkwtsuccess((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyt
assert_raises s



cO@s�y#|||�ts"td��Wn[|k
r�}tj|t|�tj�sitd||f��t|�jd�GHnXdS(Ns#Callable did not raise an exceptions%r !~ %ssutf-8(RRtretsearchRtUNICODEtencode(RRRRtkwargste((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytassert_raises_message*s
.(RR
RRRRcC@s�tjdd|�}tjdd|�}tjdd|�}tjdd|�}trrtjdd|�}ntjdd|�}||ks�t|p�d||f��dS(Ns^\s+?|\nts {2,}t s!Utus%r != %r(RtsubRR(R	R
R((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyteq_ignore_whitespace8scC@s_t|�}tt|jd|��jdd�jdd�|jdd�jdd��dS(Ntdialects
Rs	(t_get_dialectRRtcompiletreplace(telementt
assert_stringR$((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytassert_compiledHs
cC@s�|dks|dkr"tj�Syt|SWnrtk
r�ttd|�j|�}|j�t|<}|dkr�t	|_
n|dkr�t|_n|SXdS(NRssqlalchemy.dialects.%st
postgresqltmssql(
tNoneRtDefaultDialectt	_dialectstKeyErrortgetattrt
__import__tdialectsR$Rtimplicit_returningRtlegacy_schema_aliasing(tnametdialect_modtd((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyR%Ts

cO@sttj||�S(s�Context 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(tmessagesR((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytexpect_warningses
co@sit|�}t|tj�r6|tj�r6dVn/t|�sJdVnt||��
dVWdQXdS(s�Context manager which expects one or more warnings on specific
    dialects.

    The expect version **asserts** that the warnings were in fact seen.

    N(tdb_spect
isinstanceRtstring_typestconfigt_currentt_is_excludedR=(tdbR<Rtspec((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytexpect_warnings_onus"c@st�fd��}|S(s�Decorator form of expect_warnings().

    Note that emits_warning does **not** assert that the warnings
    were in fact seen.

    c@s*tdt���|||�SWdQXdS(Ntassert_(R=R(tfnRR(R<(sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytdecorate�s(R(R<RI((R<sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyt
emits_warning�sc@st��fd��}|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't����|||�SWdQXdS(N(RF(RHRR(RDR<(sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyRI�s(R(RDR<RI((RDR<sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytemits_warning_on�sc#@s��r1g|D]}tj|tj�^q
�n|�t���tj�d�����fd�}tjd|��
dVWdQX|r��s�t	ddj
�fd��D����ndS(Nc@s�|r)t|��r)�||||�S�s3dSxy�D]?}�rU|j|�sh�r:||kr:�j|�Pq:q:W|dkr��|||�n�||||�dS(N(t
issubclasstmatchtdiscardR-(Rt	exceptiontargRtfilter_(texc_clstfilterst	real_warntregextseen(sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pytour_warn�s

s
warnings.warnsWarnings were not seen: %ss, c3@s(|]}d�r|jn|VqdS(s%rN(tpattern(t.0ts(RU(sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pys	<genexpr>�s(RR&tItsettwarningstwarnR-RtpatchRtjoin(RRR<RURGRRW((RRRSRTRURVsK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyR9�s+	
(&t
__future__RRRRtsqlalchemy.engineRtutil.compatRRt
contextlibtsqlalchemy.utilRt
sqlalchemyRR:R]Rtsqla_094R-RR
RRRRtsqlalchemy.testing.assertionsR#R*R/R%R=tcontextmanagerRFRJRKRR9(((sK/opt/alt/python27/lib/python2.7/site-packages/alembic/testing/assertions.pyt<module>s6		

.					

Zerion Mini Shell 1.0