
X\Qc           @  s   d  d l  m Z d  d l Z d  d l Z e a d e j f d     YZ d e j	 f d     YZ
 d   Z d   Z e d	 k r e   n  d S(
   i(   t   with_statementNt   MyConnectionc           B  s   e  Z d    Z RS(   c         C  s   t  a t j j |   d  S(   N(   t   Truet   did_rollbackt   sqlitet
   Connectiont   rollback(   t   self(    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyR      s    (   t   __name__t
   __module__R   (    (    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyR      s   t   ContextTestsc           B  s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C  s2   t  j d d t |  _ |  j j d  t a d  S(   Ns   :memory:t   factorys   create table test(c unique)(   R   t   connectR   t   cont   executet   FalseR   (   R   (    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   setUp%   s    c         C  s   |  j  j   d  S(   N(   R   t   close(   R   (    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   tearDown+   s    c         C  s   |  j   Wd QXd S(   s7   Can the connection be used as a context manager at all?N(   R   (   R   (    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   CheckContextManager.   s    
c         C  s]   |  j   |  j  j d  Wd QX|  j  j   |  j  j d  j   d } |  j | d  d S(   s*   Is a commit called in the context manager?s"   insert into test(c) values ('foo')Ns   select count(*) from testi    i   (   R   R   R   t   fetchonet   assertEqual(   R   t   count(    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   CheckContextManagerCommit3   s
    
c         C  so   |  j  t t  y4 |  j % |  j j d  |  j j d  Wd QXWn t j k
 rZ n X|  j  t t  d S(   s,   Is a rollback called in the context manager?s   insert into test(c) values (4)N(   R   R   R   R   R   R   t   IntegrityErrorR   (   R   (    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   CheckContextManagerRollback;   s    
(   R   R	   R   R   R   R   R   (    (    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyR
   $   s
   				c          C  s"   t  j t d  }  t  j |  f  S(   Nt   Check(   t   unittestt	   makeSuiteR
   t	   TestSuite(   t	   ctx_suite(    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   suiteG   s    c          C  s    t  j   }  |  j t    d  S(   N(   R   t   TextTestRunnert   runR   (   t   runner(    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   testK   s    t   __main__(   t
   __future__R    R   t   sqlite3R   R   R   R   R   t   TestCaseR
   R   R#   R   (    (    (    s^   /tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/py25tests.pyt   <module>   s   #		