o
    a"<f_                     @   s@   d dl Z d dlmZ d dlmZ d dlmZ G dd deZdS )    N)call_command)CommandError)TestCasec                   @   s4   e Zd Zg dZdd Zdd Zdd Zdd	 Zd
S )TestMtimeCacheCommand)z*CACHE*z*custom*z*066cd253eada.jsz*d728fc7f9301.jsz*8a0fed36c317.jsz	test.txt*c                 C   s   dd | j D S )Nc                 S   s   g | ]}d | qS )z--ignore=%s ).0patternr   r   X/var/www/html/kck/venv/lib/python3.10/site-packages/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   s8   |  t td W d    d S 1 sw   Y  d S )Nmtime_cache)assertRaisesr   r   r   r   r   r	   test_handle_no_args   s   
"z)TestMtimeCacheCommand.test_handle_no_argsc                 C   st   t  }| ji d tddg|  R d|i W d    n1 s#w   Y  | }| d| | d| d S )NCACHESr   z--addstdout*Deleted mtimes of 20 files from the cache."Added mtimes of 20 files to cache.)ioStringIOsettingsr   r   getvalueassertInr   outoutputr   r   r	   test_handle_add      z%TestMtimeCacheCommand.test_handle_addc                 C   st   t  }| ji d tddg|  R d|i W d    n1 s#w   Y  | }| d| | d| d S )Nr   r   z--cleanr   r   r   )r   r   r   r   r   r   r   assertNotInr   r   r   r	   test_handle_clean   r    z'TestMtimeCacheCommand.test_handle_cleanN)__name__
__module____qualname__r   r   r   r   r"   r   r   r   r	   r      s    	r   )r   django.core.managementr   django.core.management.baser   django.testr   r   r   r   r   r	   <module>   s
    