ó
P'^c           @@  s@  d  d l  m Z d  d l Z d  d l Z d  d l m Z y d  d l m Z Wn= e	 k
 r d e
 f d     YZ d e
 f d     YZ n( Xe d d	 g  Z e d d
 d g  Z d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d   d   d   g Z d e j f d     YZ d S(   i    (   t   absolute_importN(   t   StringIO(   t
   namedtuplet   Valuec           B@  s   e  Z d    Z d   Z RS(   c         G@  s   t  j |  |  S(   N(   t   tuplet   __new__(   t   clst   args(    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   
   s    c         C@  s   i |  d d 6S(   Ni    t   value(    (   t   self(    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   _asdict   s    (   t   __name__t
   __module__R   R
   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   	   s   	t   Pointc           B@  s   e  Z d    Z d   Z RS(   c         G@  s   t  j |  |  S(   N(   R   R   (   R   R   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR      s    c         C@  s   i |  d d 6|  d d 6S(   Ni    t   xi   t   y(    (   R	   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR
      s    (   R   R   R   R
   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR      s   	R   R   R   t	   DuckValuec           B@  s   e  Z d    Z d   Z RS(   c         G@  s   t  |   |  _ d  S(   N(   R   R   (   R	   R   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   __init__   s    c         C@  s   |  j  j   S(   N(   R   R
   (   R	   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR
      s    (   R   R   R   R
   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR      s   	t	   DuckPointc           B@  s   e  Z d    Z d   Z RS(   c         G@  s   t  |   |  _ d  S(   N(   R   t   point(   R	   R   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   !   s    c         C@  s   |  j  j   S(   N(   R   R
   (   R	   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR
   $   s    (   R   R   R   R
   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR       s   	t   DeadDuckc           B@  s   e  Z d  Z RS(   N(   R   R   t   NoneR
   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   '   s   t   DeadDictc           B@  s   e  Z d  Z RS(   N(   R   R   R   R
   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   *   s   c         C@  s   |  S(   N(    (   t   v(    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   <lambda>.   t    c         C@  s   |  g S(   N(    (   R   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   /   R   c         C@  s   i |  d 6g S(   Nt   key(    (   R   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   0   R   t   TestNamedTuplec           B@  s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c      
   C@  sė   xä t  d  t d d  t d  t d d  g D]² } | j   } |  j | t j t j |    |  j | t j t j | d t	   |  j | t j t j | d t
   |  j | t j t j | d t	 d t
   q1 Wd  S(   Ni   i   t   namedtuple_as_objectt   tuple_as_array(   R   R   R   R   R
   t   assertEqualt   jsont   loadst   dumpst   Truet   False(   R	   R   t   d(    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   test_namedtuple_dumps4   s    7"(c      	   C@  s   xy t  d  t d d  g D]\ } t |  } |  j | t j t j | d t   |  j t	 t j | d t d t q Wd  S(   Ni   i   R   R   (
   R   R   t   listR   R   R    R!   R#   t   assertRaisest	   TypeError(   R	   R   t   l(    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   test_namedtuple_dumps_falseA   s    "c         C@  sC  x<t  d  t d d  t d  t d d  g D]
} | j   } t   } t j | |  |  j | t j	 | j
     t   } t j | | d t |  j | t j	 | j
     t   } t j | | d t |  j | t j	 | j
     t   } t j | | d t d t |  j | t j	 | j
     q1 Wd  S(   Ni   i   R   R   (   R   R   R   R   R
   R   R   t   dumpR   R    t   getvalueR"   R#   (   R	   R   R$   t   sio(    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   test_namedtuple_dumpJ   s&    7				c      
   C@  s   x t  d  t d d  g D]x } t |  } t   } t j | | d t |  j | t j | j	     |  j
 t t j | t   d t d t q Wd  S(   Ni   i   R   R   (   R   R   R&   R   R   R+   R#   R   R    R,   R'   R(   (   R	   R   R)   R-   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   test_namedtuple_dump_false_   s    "	c         C@  s   x t  D]~ } |  j t t j | t    t   d t t   } t j | t    | d t |  j	 t j
 | i    | j    q Wd  S(   NR   (   t   CONSTRUCTORSR'   R(   R   R+   R   R   R"   R   R   R!   R,   (   R	   t   fR-   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   test_asdict_not_callable_dumpj   s    	"	c         C@  sq   xj t  D]b } |  j t t j | t    d t |  j t j | i    t j | t    d t  q Wd  S(   NR   (	   R0   R'   R(   R   R!   R   R"   R   R   (   R	   R1   (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   test_asdict_not_callable_dumpst   s    	(   R   R   R%   R*   R.   R/   R2   R3   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyR   3   s   						
(   t
   __future__R    t   unittestt
   simplejsonR   t   simplejson.compatR   t   collectionsR   t   ImportErrorR   R   R   t   objectR   R   R   t   dictR   R0   t   TestCaseR   (    (    (    sB   /tmp/pip-unpacked-wheel-9xjeDh/simplejson/tests/test_namedtuple.pyt   <module>   s$   