๎
2!์VL  ใ               @   sZ   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z Gd d   d e  Z d S)้    )ฺcall_command)ฺCommandError)ฺTestCase)ฺStringIOc               @   sR   e  Z d  Z d d d d g Z d d   Z d d   Z d	 d
   Z d d   Z d S)ฺTestMtimeCacheCommandz*CACHE*z*custom*z*066cd253eada.jsz	test.txt*c             C   s   d d   |  j  D S)Nc             S   s   g  |  ] } d  |  q S)z--ignore=%sฉ )ฺ.0ฺpatternr   r   ๚N/tmp/pip-build-0sboevxh/django-compressor/compressor/tests/test_mtime_cache.py๚
<listcomp>   s   	 z8TestMtimeCacheCommand.default_ignore.<locals>.<listcomp>)ฺexclusion_patterns)ฺselfr   r   r
   ฺdefault_ignore   s    z$TestMtimeCacheCommand.default_ignorec          	   C   s$   |  j  t   t d  Wd  QXd  S)Nฺmtime_cache)ZassertRaisesr   r   )r   r   r   r
   ฺtest_handle_no_args   s    z)TestMtimeCacheCommand.test_handle_no_argsc             C   sn   t    } |  j d i   ! t d d d | |  j   Wd  QX| j   } |  j d |  |  j d |  d  S)NฺCACHESr   z--addฺstdoutz*Deleted mtimes of 19 files from the cache.z"Added mtimes of 19 files to cache.)r   ฺsettingsr   r   ฺgetvalueฺassertIn)r   ฺoutฺoutputr   r   r
   ฺtest_handle_add   s    	z%TestMtimeCacheCommand.test_handle_addc             C   sn   t    } |  j d i   ! t d d d | |  j   Wd  QX| j   } |  j d |  |  j d |  d  S)Nr   r   z--cleanr   z*Deleted mtimes of 19 files from the cache.z"Added mtimes of 19 files to cache.)r   r   r   r   r   r   ZassertNotIn)r   r   r   r   r   r
   ฺtest_handle_clean   s    	z'TestMtimeCacheCommand.test_handle_cleanN)ฺ__name__ฺ
__module__ฺ__qualname__r   r   r   r   r   r   r   r   r
   r      s
   	r   N)	Zdjango.core.managementr   Zdjango.core.management.baser   Zdjango.testr   Zdjango.utils.sixr   r   r   r   r   r
   ฺ<module>   s   