ó
ŠwÛjc           @   s‰   d  Z  d d l Z d d l Z d d l m Z d d l Z d d l m Z d e j f d „  ƒ  YZ	 d „  Z
 e d k r… e j ƒ  n  d S(	   s   Unit tests for abc.py.iÿÿÿÿN(   t   test_support(   t
   isabstractt   TestABCc           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 e j d „  ƒ Z RS(   c         C   sE   t  j d „  ƒ } |  j | j ƒ d „  } |  j t | d ƒ ƒ d  S(   Nc         S   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/test/test_abc.pyt   foo   s    c         S   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/test/test_abc.pyt   bar   t    t   __isabstractmethod__(   t   abct   abstractmethodt
   assertTrueR   t   assertFalset   hasattr(   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_abc.pyt   test_abstractmethod_basics   s    	c            sŠ   t  j d „  ƒ } |  j | j ƒ d „  } |  j t | d ƒ ƒ d d	 d „  ƒ  Y} d | f ‡  f d †  ƒ  Y‰  |  j ˆ  ƒ  j d ƒ d  S(
   Nc         S   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/test/test_abc.pyR      s    c         S   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/test/test_abc.pyR      R   R   t   Cc           B   s#   e  Z e j Z e j d  „  ƒ Z RS(   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/test/test_abc.pyR      s    (   t   __name__t
   __module__R   t   ABCMetat   __metaclass__t   abstractpropertyR   (    (    (    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_abc.pyR      s   	t   Dc              s   e  Z e ‡  f d  †  ƒ Z RS(   c            s   t  ˆ  |  ƒ j S(   N(   t   superR   (   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_abc.pyR   "   s    (   R   R   t   propertyR   (    (   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_abc.pyR   !   s   i   (    (   R   R   R
   R   R   R   t   assertEqualR   (   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/test/test_abc.pyt   test_abstractproperty_basics   s    	c            so  xht  j t  j g D]T‰  d d ‡  f d †  ƒ  Y} |  j | j t d g ƒ ƒ |  j t | ƒ |  j t	 | ƒ ƒ d | f d „  ƒ  Y} |  j | j t d g ƒ ƒ |  j t | ƒ |  j t	 | ƒ ƒ d | f d „  ƒ  Y} |  j | j t ƒ  ƒ | ƒ  |  j
 t	 | ƒ ƒ d | f ‡  f d	 †  ƒ  Y} |  j | j t d
 g ƒ ƒ |  j t | ƒ |  j t	 | ƒ ƒ q Wd  S(   NR   c              s)   e  Z e j Z ˆ  d  „  ƒ Z d „  Z RS(   c         S   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/test/test_abc.pyR   *   s    c         S   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/test/test_abc.pyR   ,   R   (   R   R   R   R   R   R   R   (    (   t   abstractthing(    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_abc.pyR   (   s   	R   R   c           B   s   e  Z d  „  Z RS(   c         S   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/test/test_abc.pyR   1   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/test/test_abc.pyR   0   s   t   Ec           B   s   e  Z d  „  Z RS(   c         S   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/test/test_abc.pyR   6   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/test/test_abc.pyR   5   s   t   Fc              s   e  Z ˆ  d  „  ƒ Z RS(   c         S   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/test/test_abc.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/test/test_abc.pyR   :   s   R   (    (   R   R	   R   R   t   __abstractmethods__t   sett   assertRaisest	   TypeErrorR
   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/test/test_abc.pyt   test_abstractmethod_integration&   s"    c         C   sV   d d d „  ƒ  Y} d d d „  ƒ  Y} |  j  t | | ƒ ƒ |  j  t | | ƒ ƒ d  S(   Nt   Ac           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   B   s   t   OldstyleClassc           B   s   e  Z RS(    (   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_abc.pyR"   D   s   (    (    (   R   t
   issubclass(   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_abc.pyt   test_subclass_oldstyle_classA   s    c         C   sr   d d d „  ƒ  Y} d d d „  ƒ  Y} |  j  t | | ƒ ƒ |  j t | t | ƒ ƒ ƒ |  j  t | | ƒ ƒ d  S(   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   J   s   R"   c           B   s   e  Z RS(    (   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_abc.pyR"   L   s   (    (    (   R   t
   isinstanceR
   t   type(   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_abc.pyt   test_isinstance_classI   s
    c         C   sX  d d d „  ƒ  Y} d t  f d „  ƒ  Y} | ƒ  } |  j t | | ƒ ƒ |  j t | | f ƒ ƒ |  j | | ƒ |  j | | f ƒ | j | ƒ |  j t | | ƒ ƒ |  j t | | f ƒ ƒ |  j | | ƒ |  j | | f ƒ d | f d „  ƒ  Y} | ƒ  } |  j t | | ƒ ƒ |  j t | | f ƒ ƒ |  j | | ƒ |  j | | f ƒ d  S(   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   U   s   t   Bc           B   s   e  Z RS(    (   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_abc.pyR(   W   s   R   c           B   s   e  Z RS(    (   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_abc.pyR   c   s   (    (   t   objectR   R#   t   assertNotIsInstancet   registerR
   t   assertIsInstance(   R   R!   R(   t   bR   t   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_abc.pyt   test_registration_basicsT   s$    		c         C   s¡   d d d „  ƒ  Y} d t  f d „  ƒ  Y} | ƒ  } |  j t | | ƒ ƒ |  j t | | f ƒ ƒ | j | ƒ |  j t | | ƒ ƒ |  j t | | f ƒ ƒ d  S(   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   l   s   R(   c           B   s   e  Z RS(    (   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_abc.pyR(   n   s   (    (   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/test/test_abc.pyt   test_isinstance_invalidationk   s    	c         C   së   d d d „  ƒ  Y} | j  t ƒ |  j d | ƒ |  j d | f ƒ |  j t t | ƒ ƒ |  j t t | f ƒ ƒ d | f d „  ƒ  Y} | j  t ƒ |  j d | ƒ |  j d | f ƒ |  j t t | ƒ ƒ |  j t t | f ƒ ƒ d  S(   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   x   s   i*   R(   c           B   s   e  Z RS(    (   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_abc.pyR(      s   R   (    (   R+   t   intR,   R
   R#   t
   basestringt   str(   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_abc.pyt   test_registration_builtinsw   s    c         C   sÆ   d d	 d „  ƒ  Y} | j  | ƒ d | f d „  ƒ  Y} |  j t | j  | ƒ d t f d „  ƒ  Y} | j  | ƒ | j  | ƒ d | f d „  ƒ  Y} | j  | ƒ |  j t | j  | ƒ | j  | ƒ d  S(
   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   ˆ   s   t   A1c           B   s   e  Z RS(    (   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_abc.pyR5   ‹   s   R(   c           B   s   e  Z RS(    (   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_abc.pyR(   Ž   s   R   c           B   s   e  Z RS(    (   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_abc.pyR   ’   s   (    (   R+   R   t   RuntimeErrorR)   (   R   R!   R5   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_abc.pyt   test_registration_edge_cases‡   s    c         C   s3   d t  f d „  ƒ  Y} |  j t d | j d ƒ d  S(   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   ™   s   s   Can only register classesi   (   R)   t   assertRaisesRegexpR   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_abc.pyt   test_register_non_class˜   s    c         C   sŸ  d d d „  ƒ  Y} |  j  t | | ƒ ƒ |  j  t | | f ƒ ƒ d d d „  ƒ  Y} |  j t | | ƒ ƒ |  j t | | f ƒ ƒ |  j t | | ƒ ƒ |  j t | | f ƒ ƒ d d d „  ƒ  Y} | j | ƒ d | f d „  ƒ  Y} |  j  t | | ƒ ƒ |  j  t | | f ƒ ƒ d	 | f d
 „  ƒ  Y} | j | ƒ |  j t | | ƒ ƒ |  j t | | f ƒ ƒ |  j t | | ƒ ƒ |  j t | | f ƒ ƒ |  j  t | | ƒ ƒ |  j  t | | f ƒ ƒ |  j  t | | ƒ ƒ |  j  t | | f ƒ ƒ |  j  t | | ƒ ƒ |  j  t | | f ƒ ƒ | j t ƒ d t f d „  ƒ  Y} |  j  t | | ƒ ƒ |  j  t | | f ƒ ƒ |  j d | ƒ |  j d | f ƒ d  S(   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   Ÿ   s   R(   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR(   £   s   R   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR   ©   s   t   B1c           B   s   e  Z RS(    (   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_abc.pyR:   ¬   s   t   C1c           B   s   e  Z RS(    (   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_abc.pyR;   °   s   t   MyIntc           B   s   e  Z RS(    (   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_abc.pyR<   ¾   s   i*   (    (    (    (   R
   R#   R   R+   R1   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/test/test_abc.pyt    test_registration_transitivenessž   s>    c            sy   d d	 d „  ƒ  Y} d t  f ‡  f d †  ƒ  Y‰  d | ˆ  f d „  ƒ  Y} |  j ˆ  j d ƒ | ƒ  |  j ˆ  j d ƒ d  S(
   NR!   c           B   s   e  Z e j Z RS(    (   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/test/test_abc.pyR!   Æ   s   R(   c              s   e  Z d  Z ‡  f d †  Z RS(   i    c            s%   ˆ  j  d 7_  t ˆ  |  ƒ j |  ƒ S(   Ni   (   t   counterR   t   __new__(   t   cls(   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_abc.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/test/test_abc.pyR(   È   s   R   c           B   s   e  Z RS(    (   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_abc.pyR   Í   s   i    i   (    (   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/test/test_abc.pyt   test_all_new_methods_are_calledÅ   s    c            sr   d t  f d „  ƒ  Y‰  d ˆ  f ‡  f d †  ƒ  Y} t j | ƒ } | ƒ  j ƒ  ~ t j ƒ  |  j | ƒ  d  ƒ d  S(   NR!   c           B   s#   e  Z e j Z e j d  „  ƒ Z RS(   c         S   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/test/test_abc.pyt   fØ   s    (   R   R   R   R   R   R	   RB   (    (    (    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_abc.pyR!   Ö   s   	R   c              s   e  Z ‡  f d  †  Z RS(   c            s   ˆ  j  |  ƒ d  S(   N(   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/test/test_abc.pyRB   Ü   s    (   R   R   RB   (    (   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_abc.pyR   Û   s   (   R)   t   weakreft   refRB   R    t
   gc_collectR   t   None(   R   R   t   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_abc.pyt   test_cache_leakÓ   s    
(   R   R   R   R   R    R$   R'   R/   R0   R4   R7   R9   R=   RA   R    t   requires_type_collectingRH   (    (    (    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_abc.pyR      s   											'	c           C   s   t  j t ƒ d  S(   N(   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_abc.pyt	   test_mainå   s    t   __main__(   t   __doc__t   unittestRC   t   testR    R   t   inspectR   t   TestCaseR   RK   R   t   main(    (    (    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_abc.pyt   <module>   s   Ø	