ó
¦xxTc           @   sÔ  d  d l  Z  d  d l Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d- d „  ƒ  YZ d d. d „  ƒ  YZ d d/ d „  ƒ  YZ d d0 d „  ƒ  YZ d d1 d „  ƒ  YZ d d2 d „  ƒ  YZ d d3 d „  ƒ  YZ d e  j f d „  ƒ  YZ d  e  j f d! „  ƒ  YZ d" e  j f d# „  ƒ  YZ d$ e f d% „  ƒ  YZ d& e f d' „  ƒ  YZ d( e f d) „  ƒ  YZ d* „  Z d+ „  Z  e! d, k rÐe  ƒ  n  d S(4   iÿÿÿÿNc           C   s   d S(   Nt   foo(    (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returntext   s    c           C   s   d S(   Nu   bar(    (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnunicode   s    c           C   s   d S(   Ni*   (    (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnint    s    c           C   s   d S(   Ng…ëQ¸	@(    (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnfloat"   s    c           C   s   d  S(   N(   t   None(    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnnull$   s    c           C   s
   t  d ƒ S(   Nt   blob(   t   buffer(    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnblob&   s    c           C   s   d S(   Ni   i   l        (    (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnlonglong(   s    c           C   s   d d d  S(   Ni   i    (    (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_raiseexception*   s    c         C   s   t  |  ƒ t k S(   N(   t   typet   unicode(   t   v(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isstring-   s    c         C   s   t  |  ƒ t k S(   N(   R   t   int(   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt
   func_isint/   s    c         C   s   t  |  ƒ t k S(   N(   R   t   float(   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isfloat1   s    c         C   s   t  |  ƒ t  d  ƒ k S(   N(   R   R   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isnone3   s    c         C   s   t  |  ƒ t k S(   N(   R   R   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isblob5   s    c         C   s   t  |  t t f ƒ o |  d k S(   Ni   i   l        (   t
   isinstanceR   t   long(   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   func_islonglong7   s    t
   AggrNoStepc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   d  S(   N(    (   t   self(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   __init__;   s    c         C   s   d S(   Ni   (    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   finalize>   s    (   t   __name__t
   __module__R   R   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   :   s   	t   AggrNoFinalizec           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   d  S(   N(    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   B   s    c         C   s   d  S(   N(    (   R   t   x(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   stepE   s    (   R   R   R   R!   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   A   s   	t   AggrExceptionInInitc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d d d  S(   Ni   i    (    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   I   s    c         C   s   d  S(   N(    (   R   R    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR!   L   s    c         C   s   d  S(   N(    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   O   s    (   R   R   R   R!   R   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR"   H   s   		t   AggrExceptionInStepc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d  S(   N(    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   S   s    c         C   s   d d d  S(   Ni   i    (    (   R   R    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR!   V   s    c         C   s   d S(   Ni*   (    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   Y   s    (   R   R   R   R!   R   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR#   R   s   		t   AggrExceptionInFinalizec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d  S(   N(    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   ]   s    c         C   s   d  S(   N(    (   R   R    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR!   `   s    c         C   s   d d d  S(   Ni   i    (    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   c   s    (   R   R   R   R!   R   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR$   \   s   		t   AggrCheckTypec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d  |  _ d  S(   N(   R   t   val(   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   g   s    c         C   sR   i t  d 6t d 6t d 6t d  ƒ d 6t d 6} t | | t | ƒ k ƒ |  _ d  S(   Nt   strR   R   R   R   (   R   R   R   R   R   R   R&   (   R   t	   whichTypeR&   t   theType(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR!   j   s    /c         C   s   |  j  S(   N(   R&   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   n   s    (   R   R   R   R!   R   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR%   f   s   		t   AggrSumc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d |  _  d  S(   Ng        (   R&   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   r   s    c         C   s   |  j  | 7_  d  S(   N(   R&   (   R   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR!   u   s    c         C   s   |  j  S(   N(   R&   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR   x   s    (   R   R   R   R!   R   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR*   q   s   		t   FunctionTestsc           B   sª   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   sJ  t  j d ƒ |  _ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t	 ƒ |  j j d	 d t
 ƒ |  j j d
 d t ƒ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t ƒ |  j j d d t ƒ d  S(   Ns   :memory:t
   returntexti    t   returnunicodet	   returnintt   returnfloatt
   returnnullt
   returnblobt   returnlonglongt   raiseexceptiont   isstringi   t   isintt   isfloatt   isnonet   isblobt
   islonglong(   t   sqlitet   connectt   cont   create_functionR   R   R   R   R   R	   R
   R   R   R   R   R   R   R   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   setUp|   s    c         C   s   |  j  j ƒ  d  S(   N(   R<   t   close(   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   tearDown�   s    c         C   sE   y* |  j  j d d d „  ƒ |  j d ƒ Wn t j k
 r@ n Xd  S(   Nt   blaiœÿÿÿc         S   s   d |  S(   Ni   (    (   R    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   <lambda>”   s    s&   should have raised an OperationalError(   R<   R=   t   failR:   t   OperationalError(   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncErrorOnCreate’   s
    c         C   sU   d „  } | ƒ  } | t  ƒ  d <|  j j d d | ƒ |  j j ƒ  } | j d ƒ d  S(   Nc          S   s   d „  }  |  S(   Nc           S   s   d S(   Ni   (    (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   f›   s    (    (   RF   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   getfuncš   s    	R    t   reftesti    s   select reftest()(   t   globalsR<   R=   t   cursort   execute(   R   RG   RF   t   cur(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncRefCount™   s    		c         C   sV   |  j  j ƒ  } | j d ƒ | j ƒ  d } |  j t | ƒ t ƒ |  j | d ƒ d  S(   Ns   select returntext()i    R    (   R<   RJ   RK   t   fetchonet   assertEqualR   R   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnText¥   s
    c         C   sV   |  j  j ƒ  } | j d ƒ | j ƒ  d } |  j t | ƒ t ƒ |  j | d ƒ d  S(   Ns   select returnunicode()i    u   bar(   R<   RJ   RK   RN   RO   R   R   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnUnicode¬   s
    c         C   sV   |  j  j ƒ  } | j d ƒ | j ƒ  d } |  j t | ƒ t ƒ |  j | d ƒ d  S(   Ns   select returnint()i    i*   (   R<   RJ   RK   RN   RO   R   R   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnInt³   s
    c         C   sn   |  j  j ƒ  } | j d ƒ | j ƒ  d } |  j t | ƒ t ƒ | d k  sZ | d k rj |  j d ƒ n  d  S(   Ns   select returnfloat()i    gé&1¬	@gTã¥›Ä 	@s   wrong value(   R<   RJ   RK   RN   RO   R   R   RC   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnFloatº   s    c         C   s\   |  j  j ƒ  } | j d ƒ | j ƒ  d } |  j t | ƒ t d  ƒ ƒ |  j | d  ƒ d  S(   Ns   select returnnull()i    (   R<   RJ   RK   RN   RO   R   R   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnNullÂ   s
    c         C   s\   |  j  j ƒ  } | j d ƒ | j ƒ  d } |  j t | ƒ t ƒ |  j | t d ƒ ƒ d  S(   Ns   select returnblob()i    R   (   R<   RJ   RK   RN   RO   R   R   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnBlobÉ   s
    c         C   s@   |  j  j ƒ  } | j d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select returnlonglong()i    i   i   l        (   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnLongLongÐ   s    c         C   sk   |  j  j ƒ  } y( | j d ƒ | j ƒ  |  j d ƒ Wn- t j k
 rf } |  j | j d d ƒ n Xd  S(   Ns   select raiseexception()s#   should have raised OperationalErrori    s&   user-defined function raised exception(	   R<   RJ   RK   RN   RC   R:   RD   RO   t   args(   R   RL   t   e(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncExceptionÖ   s    
c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select isstring(?)R    i    i   (   s   foo(   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamStringß   s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select isint(?)i*   i    i   (   i*   (   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamIntå   s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select isfloat(?)g…ëQ¸	@i    i   (   g…ëQ¸	@(   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamFloatë   s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select isnone(?)i    i   (   N(   R<   RJ   RK   R   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamNoneñ   s    c         C   sL   |  j  j ƒ  } | j d t d ƒ f ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select isblob(?)R   i    i   (   R<   RJ   RK   R   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamBlob÷   s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select islonglong(?)i   i*   i    l        (   l        (   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamLongLongý   s    (   R   R   R>   R@   RE   RM   RP   RQ   RR   RS   RT   RU   RV   RY   RZ   R[   R\   R]   R^   R_   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR+   {   s$   																		t   AggregateTestsc           B   s†   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z RS(   c         C   sñ   t  j d ƒ |  _ |  j j ƒ  } | j d ƒ | j d d d d d  t d ƒ f ƒ |  j j d d	 t ƒ |  j j d
 d	 t	 ƒ |  j j d d	 t
 ƒ |  j j d d	 t ƒ |  j j d d	 t ƒ |  j j d d t ƒ |  j j d d	 t ƒ d  S(   Ns   :memory:s´   
            create table test(
                t text,
                i integer,
                f float,
                n,
                b blob
                )
            s6   insert into test(t, i, f, n, b) values (?, ?, ?, ?, ?)R    i   g…ëQ¸	@R   t   nostepi   t
   nofinalizet   excInitt   excStept   excFinalizet	   checkTypei   t   mysum(   R:   R;   R<   RJ   RK   R   R   t   create_aggregateR   R   R"   R#   R$   R%   R*   (   R   RL   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR>     s    	c         C   s   d  S(   N(    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR@     s    c         C   sB   y' |  j  j d d t ƒ |  j d ƒ Wn t j k
 r= n Xd  S(   NRA   iœÿÿÿs&   should have raised an OperationalError(   R<   R=   R*   RC   R:   RD   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrErrorOnCreate   s
    c         C   s^   |  j  j ƒ  } y | j d ƒ |  j d ƒ Wn* t k
 rY } |  j | j d d ƒ n Xd  S(   Ns   select nostep(t) from tests$   should have raised an AttributeErrori    s+   AggrNoStep instance has no attribute 'step'(   R<   RJ   RK   RC   t   AttributeErrorRO   RW   (   R   RL   RX   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrNoStep'  s    c         C   sq   |  j  j ƒ  } y. | j d ƒ | j ƒ  d } |  j d ƒ Wn- t j k
 rl } |  j | j d d ƒ n Xd  S(   Ns   select nofinalize(t) from testi    s&   should have raised an OperationalErrors7   user-defined aggregate's 'finalize' method raised error(	   R<   RJ   RK   RN   RC   R:   RD   RO   RW   (   R   RL   R&   RX   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrNoFinalize/  s    c         C   sq   |  j  j ƒ  } y. | j d ƒ | j ƒ  d } |  j d ƒ Wn- t j k
 rl } |  j | j d d ƒ n Xd  S(   Ns   select excInit(t) from testi    s&   should have raised an OperationalErrors7   user-defined aggregate's '__init__' method raised error(	   R<   RJ   RK   RN   RC   R:   RD   RO   RW   (   R   RL   R&   RX   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrExceptionInInit8  s    c         C   sq   |  j  j ƒ  } y. | j d ƒ | j ƒ  d } |  j d ƒ Wn- t j k
 rl } |  j | j d d ƒ n Xd  S(   Ns   select excStep(t) from testi    s&   should have raised an OperationalErrors3   user-defined aggregate's 'step' method raised error(	   R<   RJ   RK   RN   RC   R:   RD   RO   RW   (   R   RL   R&   RX   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrExceptionInStepA  s    c         C   sq   |  j  j ƒ  } y. | j d ƒ | j ƒ  d } |  j d ƒ Wn- t j k
 rl } |  j | j d d ƒ n Xd  S(   Ns   select excFinalize(t) from testi    s&   should have raised an OperationalErrors7   user-defined aggregate's 'finalize' method raised error(	   R<   RJ   RK   RN   RC   R:   RD   RO   RW   (   R   RL   R&   RX   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrExceptionInFinalizeJ  s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('str', ?)R    i    i   (   s   foo(   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamStrS  s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('int', ?)i*   i    i   (   i*   (   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamIntY  s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('float', ?)g…ëQ¸	@i    i   (   g…ëQ¸	@(   R<   RJ   RK   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamFloat_  s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('None', ?)i    i   (   N(   R<   RJ   RK   R   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamNonee  s    c         C   sL   |  j  j ƒ  } | j d t d ƒ f ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('blob', ?)R   i    i   (   R<   RJ   RK   R   RN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamBlobk  s    c         C   sf   |  j  j ƒ  } | j d ƒ | j d d	 d
 d g ƒ | j d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   delete from tests   insert into test(i) values (?)i
   i   i   s   select mysum(i) from testi    i<   (   i
   (   i   (   i   (   R<   RJ   RK   t   executemanyRN   RO   (   R   RL   R&   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckAggrSumq  s    (   R   R   R>   R@   Ri   Rk   Rl   Rm   Rn   Ro   Rp   Rq   Rr   Rs   Rt   Rv   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR`     s   																	t   AuthorizerTestsc           B   s;   e  Z e d  „  ƒ Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s<   |  t  j k r t  j S| d k s. | d k r5 t  j St  j S(   Nt   c2t   t2(   R:   t   SQLITE_SELECTt   SQLITE_DENYt	   SQLITE_OK(   t   actiont   arg1t   arg2t   dbnamet   source(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   authorizer_cbz  s
    c         C   sI   t  j d ƒ |  _ |  j j d ƒ |  j j d ƒ |  j j |  j ƒ d  S(   Ns   :memory:s¿   
            create table t1 (c1, c2);
            create table t2 (c1, c2);
            insert into t1 (c1, c2) values (1, 2);
            insert into t2 (c1, c2) values (4, 5);
            s   select c2 from t2(   R:   R;   R<   t   executescriptRK   t   set_authorizerR‚   (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR>   ‚  s
    	c         C   s   d  S(   N(    (   R   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR@   �  s    c         C   sp   y |  j  j d ƒ WnH t j k
 r^ } | j d j d ƒ sZ |  j d | j d ƒ n  d  SX|  j d ƒ d  S(   Ns   select * from t2i    t
   prohibiteds   wrong exception text: %ss9   should have raised an exception due to missing privileges(   R<   RK   R:   t   DatabaseErrorRW   t   endswithRC   (   R   RX   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   test_table_access“  s    c         C   sp   y |  j  j d ƒ WnH t j k
 r^ } | j d j d ƒ sZ |  j d | j d ƒ n  d  SX|  j d ƒ d  S(   Ns   select c2 from t1i    R…   s   wrong exception text: %ss9   should have raised an exception due to missing privileges(   R<   RK   R:   R†   RW   R‡   RC   (   R   RX   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   test_column_accessœ  s    (   R   R   t   staticmethodR‚   R>   R@   Rˆ   R‰   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyRw   y  s
   				t   AuthorizerRaiseExceptionTestsc           B   s   e  Z e d  „  ƒ Z RS(   c         C   s@   |  t  j k r t ‚ n  | d k s0 | d k r9 t ‚ n  t  j S(   NRx   Ry   (   R:   Rz   t
   ValueErrorR|   (   R}   R~   R   R€   R�   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR‚   ¦  s
    		(   R   R   RŠ   R‚   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR‹   ¥  s   t   AuthorizerIllegalTypeTestsc           B   s   e  Z e d  „  ƒ Z RS(   c         C   s6   |  t  j k r d S| d k s+ | d k r/ d St  j S(   Ng        Rx   Ry   (   R:   Rz   R|   (   R}   R~   R   R€   R�   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR‚   ¯  s
    (   R   R   RŠ   R‚   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR�   ®  s   t   AuthorizerLargeIntegerTestsc           B   s   e  Z e d  „  ƒ Z RS(   c         C   s6   |  t  j k r d S| d k s+ | d k r/ d St  j S(   Ni   i    Rx   Ry   l        l        (   R:   Rz   R|   (   R}   R~   R   R€   R�   (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyR‚   ¸  s
    (   R   R   RŠ   R‚   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyRŽ   ·  s   c          C   sm   t  j t d ƒ }  t  j t d ƒ } t  j t ƒ } t  j |  | | t  j t ƒ t  j t ƒ t  j t ƒ f ƒ S(   Nt   Check(	   t   unittestt	   makeSuiteR+   R`   Rw   t	   TestSuiteR‹   R�   RŽ   (   t   function_suitet   aggregate_suitet   authorizer_suite(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   suiteÁ  s    c          C   s    t  j ƒ  }  |  j t ƒ  ƒ d  S(   N(   R�   t   TextTestRunnert   runR–   (   t   runner(    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   testÎ  s    t   __main__(    (    (    (    (    (    (    ("   R�   t   sqlite3R:   R   R   R   R   R   R	   R
   R   R   R   R   R   R   R   R   R   R"   R#   R$   R%   R*   t   TestCaseR+   R`   Rw   R‹   R�   RŽ   R–   Rš   R   (    (    (    sF   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/sqlite3/test/userfunctions.pyt   <module>   s@   														



ˆv,		
		