ó
o§ãOc           @   sv   d  d l  m Z d  d l Z g  e j D] Z e d ^ q& Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d S(
   iÿÿÿÿ(   t   assert_raisesNi    c           C   sd   t  j d d d g ƒ j d d ƒ d k s0 t ‚ t  j d d d g ƒ j d d ƒ d k s` t ‚ d  S(   Ni   i   i   t    t    s   [1,2,3](   t   anyjsont   dumpst   replacet   AssertionErrort	   serialize(    (    (    s=   /home/runeh/development/anyjson/tests/test_implementations.pyt   test_default_serialization   s    0c           C   sL   t  j d ƒ d d d g k s$ t ‚ t  j d ƒ d d d g k sH t ‚ d  S(   Ns   [1,2,3]i   i   i   (   R   t   loadsR   t   deserialize(    (    (    s=   /home/runeh/development/anyjson/tests/test_implementations.pyt   test_default_deserialization   s    $c          C   s   x– t  D]Ž }  y t j |  ƒ Wn t k
 r4 q n Xt j d d d g ƒ j d d ƒ d k se t ‚ t j d d d g ƒ j d d ƒ d k s t ‚ q Wd  S(   Ni   i   i   R   R   s   [1,2,3](   t   modnamesR   t   force_implementationt   ImportErrorR   R   R   R   (   t   name(    (    s=   /home/runeh/development/anyjson/tests/test_implementations.pyt   test_forced_serialization   s    0c          C   s…   x~ t  D]v }  y t j |  ƒ Wn t k
 r4 q n Xt j d ƒ d d d g k sY t ‚ t j d ƒ d d d g k s t ‚ q Wd  S(   Ns   [1,2,3]i   i   i   (   R   R   R   R   R	   R   R
   (   R   (    (    s=   /home/runeh/development/anyjson/tests/test_implementations.pyt   test_forced_deserialization   s    $c          C   s•   xŽ t  D]† }  y t j |  ƒ Wn t k
 r4 q n Xt t t j t ƒ  g ƒ t t t j t ƒ  g ƒ t t	 t j
 d ƒ t t	 t j d ƒ q Wd  S(   Nt   [(   R   R   R   R   R    t	   TypeErrorR   t   objectR   t
   ValueErrorR	   R
   (   R   (    (    s=   /home/runeh/development/anyjson/tests/test_implementations.pyt   test_exceptions&   s    c           C   sE   y t  j d ƒ Wn t k
 r% d  SXd t  j d ƒ k sA t ‚ d  S(   Nt   jsont   foou   {"foo": "bar"}(   R   R   R   R	   R   (    (    (    s=   /home/runeh/development/anyjson/tests/test_implementations.pyt   test_json_loads_unicode3   s
    (   t
   nose.toolsR    R   t   _modulest   eR   R   R   R   R   R   R   (    (    (    s=   /home/runeh/development/anyjson/tests/test_implementations.pyt   <module>   s    					