File manager - Edit - /opt/imh-python/lib/python2.7/site-packages/werkzeug/testsuite/contrib/cache.pyc
Back
� �ْSc @ s� d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z y] d d l Z y3 d d l m Z e j d d � j j d d � Wn e k r� d Z n XWn e k r� d Z n Xy d d l Z Wnc e k rNy d d l m Z WqOe k rJy d d l Z WqKe k rFd Z qKXqOXn Xd e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d � Z d S( s� werkzeug.testsuite.cache ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the cache system :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. i����N( t WerkzeugTestCase( t cache( t ConnectionErrort key_prefixs werkzeug-test-case:t testt connection( t memcachet SimpleCacheTestCasec B s e Z d � Z d � Z RS( c C s� t j � } | j d d � | j d d � | j d d � } d | k sP t � d | d k sf t � d | k sx t � d | d k s� t � d S( Nt at b( R t SimpleCachet sett get_dictt AssertionError( t selft ct d( ( sO /opt/imh-python/lib/python2.7/site-packages/werkzeug/testsuite/contrib/cache.pyt test_get_dict+ s c C s� t j � } | j i d d 6d d 6d d 6� | j d � d k sI t � | j d � t d � D� � | j d � d k s� t � d S( Ni i i i c s s | ] } | | | f Vq d S( N( ( t .0t i( ( sO /opt/imh-python/lib/python2.7/site-packages/werkzeug/testsuite/contrib/cache.pys <genexpr>9 s i ( R R t set_manyt getR t range( R R ( ( sO /opt/imh-python/lib/python2.7/site-packages/werkzeug/testsuite/contrib/cache.pyt test_set_many5 s "( t __name__t __module__R R ( ( ( sO /opt/imh-python/lib/python2.7/site-packages/werkzeug/testsuite/contrib/cache.pyR ) s t FileSystemCacheTestCasec B s# e Z d � Z d � Z d � Z RS( c C s� t j � } z� t j d | � } x. t d � D] } | j t | � | | � q. Wx? t d � D]1 } | j t | � � } | | | k s_ t � q_ WWd t j | � Xd S( Nt cache_diri ( t tempfilet mkdtempR t FileSystemCacheR R t strR R t shutilt rmtree( R t tmp_dirR R t result( ( sO /opt/imh-python/lib/python2.7/site-packages/werkzeug/testsuite/contrib/cache.pyt test_set_get? s c C s� d } t j � } t j d | d | � } x. t d | � D] } | j t | � | � q; Wt j | � } t j | � t | � | k s� t � d S( Ni R t thresholdi ( R R R R R R R t ost listdirR R! t lenR ( R t THRESHOLDR"