ó
wŰjc           @   s   d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d e j f d     YZ	 d   Z
 e d k r e
   n  d S(   sS   Unit tests for buffer objects.

For now, tests just new or changed functionality.

i˙˙˙˙N(   t   test_supportt   BufferTestsc           B   s>   e  Z d    Z d   Z d   Z d   Z e j d    Z RS(   c      
   C   s˘   d j  d   t t d d d   D  } t |  } d } x^ | D]V } xM | D]E } x< | d D]0 } |  j | | | |  | | | |   qb WqQ WqD Wd  S(   Nt    c         s   s   |  ] } t  |  Vq d  S(   N(   t   chr(   t   .0t   c(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pys	   <genexpr>   s    i˙   i˙˙˙˙i    i   i   i   i,  iţ˙˙˙iá˙˙˙iÔţ˙˙(
   i    Ni   i   i   i,  i˙˙˙˙iţ˙˙˙iá˙˙˙iÔţ˙˙(   t   joint   listt   ranget   buffert   Nonet   assertEqual(   t   selft   st   bt   indicest   startt   stopt   step(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pyt   test_extended_getslice   s    +c         C   s]   d j  d   t t d d d   D  } t |  } t |  } |  j | j   |  d  S(   NR   c         s   s   |  ] } t  |  Vq 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/test/test_buffer.pys	   <genexpr>   s    i˙   i˙˙˙˙(   R   R   R   R	   t
   memoryviewR   t   tobytes(   R   R   R   t   m(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pyt   test_newbuffer_interface   s    +c         C   s<   t  d  } t | t j t j  } |  j | d  d  d  S(   Ns
   hola mundoi   R   (   t	   bytearrayR	   t   syst   maxsizeR   (   R   t   datat   buf(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pyt!   test_large_buffer_size_and_offset$   s    c         C   sY   t  d  } |  j t  8 t j   % t j d d t  t j |  Wd  QXWd  QXd  S(   Nt   abct   ignores   .*buffer(   R	   t   assertRaisest	   TypeErrort   warningst   catch_warningst   filterwarningst   DeprecationWarningt   copy(   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/test/test_buffer.pyt	   test_copy)   s
     c         C   sy   t  d  } x: t d  D], } |  j t   t j | |  Wd  QXq Wt j d t f   t j | d  Wd  QXd  S(   NR   i   s   .*buffer(	   R	   R   R    R!   t   picklet   dumpsR    t   check_py3k_warningsR%   (   R   R   t   proto(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pyt   test_pickle/   s    (	   t   __name__t
   __module__R   R   R   R'   R    t   cpython_onlyR,   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pyR      s
   				c           C   s-   t  j d t f   t  j t  Wd  QXd  S(   Ns   buffer.. not supported(   R    R*   R%   t   run_unittestR   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pyt	   test_main:   s    	t   __main__(   t   __doc__R&   R(   R   t   unittestR"   t   testR    t   TestCaseR   R1   R-   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_buffer.pyt   <module>   s   ,	