U
    O5[
  ã                   @   s<   d dl mZ d dlZd dlZd dlmZ G dd„ deƒZdS )é    )ÚTestCaseN)ÚStringIOc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )Ú
TestIndentc              
   C   sü   dgdgg dddddidd	d
œg}t  d¡}t |¡}tj|dddd}tj|dddd}tj|dddd}t |¡}t |¡}t |¡}	t |¡}
|  ||¡ |  ||¡ |  |	|¡ |  |
|¡ |  || dd¡¡ |  || dd¡¡ |  ||¡ d S )NZblorpieZwhoopsz	d-shtaeouz	d-nthiouhzi-vhbjkhnthZniftyéW   ZyesF)ZfieldZ	morefielda3          [
        	[
        		"blorpie"
        	],
        	[
        		"whoops"
        	],
        	[],
        	"d-shtaeou",
        	"d-nthiouh",
        	"i-vhbjkhnth",
        	{
        		"nifty": 87
        	},
        	{
        		"field": "yes",
        		"morefield": false
        	}
        ]ú	T©ú,ú: )ÚindentZ	sort_keysÚ
separatorsz  é   )ÚtextwrapÚdedentÚjsonÚdumpsÚloadsÚassertEqualÚreplace)ÚselfÚhÚexpectÚd1Zd2Zd3Zd4Zh1Zh2Zh3Zh4© r   ú>/usr/lib/python3/dist-packages/simplejson/tests/test_indent.pyÚtest_indent   s*     þ





zTestIndent.test_indentc                    s.   ddi‰ ‡ ‡fdd„}|ddƒ |d dƒ d S )Né   é   c                    sD   t jˆ | d}ˆ ||¡ tƒ }t jˆ || d ˆ | ¡ |¡ d S )N©r
   )r   r   r   r   ÚdumpÚgetvalue)r
   Zexpectedr   Zsio©r   r   r   r   Úcheck:   s
    z&TestIndent.test_indent0.<locals>.checkr   z
{
"3": 1
}z{"3": 1}r   )r   r!   r   r    r   Útest_indent08   s    	
zTestIndent.test_indent0c                 C   s^   ddddg}d}d}|   |tj|ddd	¡ |   |tj|dd
d	¡ |   |tj|dd¡ d S )Nr   r   r   é   z[
1,
2,
3,
4
]z[
1, 
2, 
3, 
4
]r   )z, r	   )r
   r   r   r   )r   r   r   )r   Zlstr   Zexpect_spacesr   r   r   Útest_separatorsG   s    þþþzTestIndent.test_separatorsN)Ú__name__Ú
__module__Ú__qualname__r   r"   r$   r   r   r   r   r      s   0r   )Zunittestr   r   Z
simplejsonr   Zsimplejson.compatr   r   r   r   r   r   Ú<module>   s   