ó
�wÛjc           @   sä  d  d l  Z  d  d l Z d  d l m 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 d0 d „  ƒ  YZ d d1 d „  ƒ  YZ d d2 d „  ƒ  YZ d d3 d „  ƒ  YZ d d4 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(5   iÿÿÿÿN(   t   test_supportc           C   s   d S(   Nt   foo(    (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returntext   s    c           C   s   d S(   Nu   bar(    (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnunicode   s    c           C   s   d S(   Ni*   (    (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnint!   s    c           C   s   d S(   Ng…ëQ¸	@(    (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnfloat#   s    c           C   s   d  S(   N(   t   None(    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnnull%   s    c           C   s!   t  j ƒ  � t d ƒ SWd  QXd  S(   Nt   blob(   R    t   check_py3k_warningst   buffer(    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnblob'   s    c           C   s   d S(   Ni   i   I   €    (    (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_returnlonglong*   s    c           C   s   d d d  S(   Ni   i    (    (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_raiseexception,   s    c         C   s   t  |  ƒ t k S(   N(   t   typet   unicode(   t   v(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isstring/   s    c         C   s   t  |  ƒ t k S(   N(   R   t   int(   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt
   func_isint1   s    c         C   s   t  |  ƒ t k S(   N(   R   t   float(   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isfloat3   s    c         C   s   t  |  ƒ t  d  ƒ k S(   N(   R   R   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isnone5   s    c         C   s   t  |  ƒ t k S(   N(   R   R
   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_isblob7   s    c         C   s   t  |  t t f ƒ o |  d k S(   Ni   i   I   €    (   t
   isinstanceR   t   long(   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   func_islonglong9   s    t
   AggrNoStepc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   d  S(   N(    (   t   self(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   __init__=   s    c         C   s   d S(   Ni   (    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   finalize@   s    (   t   __name__t
   __module__R   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   D   s    c         C   s   d  S(   N(    (   R   t   x(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   stepG   s    (   R   R    R   R#   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR!   C   s   	t   AggrExceptionInInitc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d d d  S(   Ni   i    (    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   K   s    c         C   s   d  S(   N(    (   R   R"   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR#   N   s    c         C   s   d  S(   N(    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   Q   s    (   R   R    R   R#   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR$   J   s   		t   AggrExceptionInStepc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d  S(   N(    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   U   s    c         C   s   d d d  S(   Ni   i    (    (   R   R"   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR#   X   s    c         C   s   d S(   Ni*   (    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   [   s    (   R   R    R   R#   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR%   T   s   		t   AggrExceptionInFinalizec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d  S(   N(    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   _   s    c         C   s   d  S(   N(    (   R   R"   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR#   b   s    c         C   s   d d d  S(   Ni   i    (    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   e   s    (   R   R    R   R#   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   i   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(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR#   l   s    /c         C   s   |  j  S(   N(   R(   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   p   s    (   R   R    R   R#   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR'   h   s   		t   AggrSumc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d |  _  d  S(   Ng        (   R(   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   t   s    c         C   s   |  j  | 7_  d  S(   N(   R(   (   R   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR#   w   s    c         C   s   |  j  S(   N(   R(   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR   z   s    (   R   R    R   R#   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR,   s   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   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   setUp~   s    c         C   s   |  j  j ƒ  d  S(   N(   R>   t   close(   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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"   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   <lambda>–   t    s&   should have raised an OperationalError(   R>   R?   t   failR<   t   OperationalError(   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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   (    (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   f�   s    (    (   RI   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   getfuncœ   s    	R   t   reftesti    s   select reftest()(   t   globalsR>   R?   t   cursort   execute(   R   RJ   RI   t   cur(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   t   fetchonet   assertEqualR   R   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RR   R   R   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RR   R   R   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RR   R   R   RF   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RR   R   R   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckFuncReturnNullÄ   s
    c         C   so   |  j  j ƒ  } | j d ƒ | j ƒ  d } t j ƒ  �1 |  j t | ƒ t ƒ |  j | t d ƒ ƒ Wd  QXd  S(   Ns   select returnblob()i    R   (	   R>   RM   RN   RQ   R    R	   RR   R   R
   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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   I   €    (   R>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RF   R<   RG   RR   t   args(   R   RO   t   e(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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   (   R   (   R>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   R   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamNoneô   s    c         C   s_   |  j  j ƒ  } t j ƒ  � | j d t d ƒ f ƒ Wd  QX| j ƒ  d } |  j | d ƒ d  S(   Ns   select isblob(?)R   i    i   (   R>   RM   R    R	   RN   R
   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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    I       (   I       (   R>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckParamLongLong  s    (   R   R    R@   RB   RH   RP   RS   RT   RU   RV   RW   RX   RY   R\   R]   R^   R_   R`   Ra   Rb   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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 ƒ t j ƒ  �* | j d d d d d  t d ƒ f ƒ Wd  QX|  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>   RM   RN   R    R	   R   R
   t   create_aggregateR   R!   R$   R%   R&   R'   R,   (   R   RO   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR@     s    	"c         C   s   d  S(   N(    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyRB      s    c         C   sB   y' |  j  j d d t ƒ |  j d ƒ Wn t j k
 r= n Xd  S(   NRC   iœÿÿÿs&   should have raised an OperationalError(   R>   R?   R,   RF   R<   RG   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RF   t   AttributeErrorRR   RZ   (   R   RO   R[   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RM   RN   RQ   RF   R<   RG   RR   RZ   (   R   RO   R(   R[   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrNoFinalize4  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>   RM   RN   RQ   RF   R<   RG   RR   RZ   (   R   RO   R(   R[   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrExceptionInInit=  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>   RM   RN   RQ   RF   R<   RG   RR   RZ   (   R   RO   R(   R[   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrExceptionInStepF  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>   RM   RN   RQ   RF   R<   RG   RR   RZ   (   R   RO   R(   R[   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrExceptionInFinalizeO  s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('str', ?)R   i    i   (   R   (   R>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamStrX  s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('int', ?)i*   i    i   (   i*   (   R>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamInt^  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>   RM   RN   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamFloatd  s    c         C   sC   |  j  j ƒ  } | j d d ƒ | j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('None', ?)i    i   (   N(   R>   RM   RN   R   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamNonej  s    c         C   s_   |  j  j ƒ  } t j ƒ  � | j d t d ƒ f ƒ Wd  QX| j ƒ  d } |  j | d ƒ d  S(   Ns   select checkType('blob', ?)R   i    i   (   R>   RM   R    R	   RN   R
   RQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckParamBlobp  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>   RM   RN   t   executemanyRQ   RR   (   R   RO   R(   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   CheckAggrCheckAggrSumw  s    (   R   R    R@   RB   Rl   Rn   Ro   Rp   Rq   Rr   Rs   Rt   Ru   Rv   Rw   Ry   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyRc     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(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   authorizer_cb€  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   executescriptRN   t   set_authorizerR…   (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR@   ˆ  s
    	c         C   s   d  S(   N(    (   R   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyRB   –  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>   RN   R<   t   DatabaseErrorRZ   t   endswithRF   (   R   R[   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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>   RN   R<   R‰   RZ   RŠ   RF   (   R   R[   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   test_column_access¢  s    (   R   R    t   staticmethodR…   R@   RB   R‹   RŒ   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyRz     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(   NR{   R|   (   R<   R}   t
   ValueErrorR   (   R€   R�   R‚   Rƒ   R„   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR…   ¬  s
    		(   R   R    R�   R…   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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        R{   R|   (   R<   R}   R   (   R€   R�   R‚   Rƒ   R„   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR…   µ  s
    (   R   R    R�   R…   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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    R{   R|   I       I       (   R<   R}   R   (   R€   R�   R‚   Rƒ   R„   (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyR…   ¾  s
    (   R   R    R�   R…   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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-   Rc   Rz   t	   TestSuiteRŽ   R�   R‘   (   t   function_suitet   aggregate_suitet   authorizer_suite(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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(    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/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&   R'   R,   t   TestCaseR-   Rc   Rz   RŽ   R�   R‘   R™   R   (    (    (    s�   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/sqlite3/test/userfunctions.pyt   <module>   sB   														



Šx,		
		