~ubuntu-branches/ubuntu/saucy/beaker/saucy

« back to all changes in this revision

Viewing changes to tests/test_memcached.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2010-03-03 00:37:43 UTC
  • mfrom: (1.1.16 upstream) (2.1.18 sid)
  • Revision ID: james.westby@ubuntu.com-20100303003743-ydl9a2st185leauo
Tags: 1.5.3-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
from beaker.cache import clsmap, Cache
5
5
from beaker.middleware import CacheMiddleware, SessionMiddleware
 
6
from beaker.exceptions import InvalidCacheBackendError
6
7
from nose import SkipTest
7
8
from webtest import TestApp
8
9
 
9
 
if isinstance(clsmap.get('ext:memcached'), Exception):
10
 
    raise SkipTest("'memcache' or 'cmemcache' is not installed, can't test "
11
 
                   "memcached backend")
 
10
 
 
11
try:
 
12
    clsmap['ext:memcached']._init_dependencies()
 
13
except InvalidCacheBackendError:
 
14
    raise SkipTest("an appropriate memcached backend is not installed")
12
15
 
13
16
mc_url = '127.0.0.1:11211'
14
 
loc = os.path.sep.join([os.path.dirname(os.path.abspath(__file__)), 'sessions'])
 
17
 
 
18
def teardown():
 
19
    import shutil
 
20
    shutil.rmtree('./cache', True)
15
21
 
16
22
def simple_session_app(environ, start_response):
17
23
    session = environ['beaker.session']