Ben Bangert avatar Ben Bangert committed 80f0ced Merge

Comments (0)

Files changed (8)

 verbose=True
 verbosity=2
 with-doctest=True
-with-coverage=True
-cover-erase=True
-cover-tests=True
-cover-package=beaker
+# Disabled here as they're invalid to setup.py test
+#with-coverage=True
+#cover-erase=True
+#cover-tests=True
+#cover-package=beaker
       packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
       zip_safe=False,
       install_requires=[],
-      extras_require = {
+      extras_require={
           'crypto':["pycryptopp>=0.3.0"]
       },
+      test_suite='nose.collector',
+      tests_require=['nose', 'webtest'],
       entry_points="""
           [paste.filter_factory]
           beaker_session = beaker.middleware:session_filter_factory

tests/test_cache.py

 # coding: utf-8
-from paste.fixture import *
 from beaker.middleware import CacheMiddleware
 from beaker.cache import Cache
+from webtest import TestApp
 
 def simple_app(environ, start_response):
     clear = False

tests/test_container.py

+import os
+import random
+import time
+import sys
+import weakref
+import test_base
 from beaker.container import *
 from beaker.synchronization import Synchronizer
-import random, time, weakref, sys
-import test_base
-import sys, os, gc
-
 
 # container test -
 # tests the container's get_value() function mostly, to insure

tests/test_database.py

 # coding: utf-8
-from paste.fixture import *
+from beaker.cache import clsmap, Cache
 from beaker.middleware import CacheMiddleware
-from beaker.cache import Cache
+from nose import SkipTest
+from webtest import TestApp
+
+if 'ext:database' not in clsmap:
+    raise SkipTest("'sqlalchemy' is not installed, can't test database "
+                   "backend")
 
 db_url = 'sqlite:///test.db'
 

tests/test_increment.py

 import re
 import os
 
-from paste.fixture import TestApp
 from beaker.middleware import SessionMiddleware
+from webtest import TestApp
 
 loc = os.path.sep.join([os.path.dirname(os.path.abspath(__file__)), 'sessions'])
 
     app = TestApp(SessionMiddleware(simple_app))
     res = app.get('/nosave')
     assert 'current value is: 1' in res
-    assert [] == res.all_headers('Set-Cookie')
+    assert [] == res.headers.getall('Set-Cookie')
     res = app.get('/nosave')
     assert 'current value is: 1' in res
     
     res = app.get('/')
     assert 'current value is: 1' in res
-    assert len(res.all_headers('Set-Cookie')) > 0
+    assert len(res.headers.getall('Set-Cookie')) > 0
     res = app.get('/')
-    assert [] == res.all_headers('Set-Cookie')
+    assert [] == res.headers.getall('Set-Cookie')
     assert 'current value is: 2' in res
 
 def test_load_session_by_id():

tests/test_memcached.py

 # coding: utf-8
-from paste.fixture import *
+from beaker.cache import clsmap, Cache
 from beaker.middleware import CacheMiddleware
-from beaker.cache import Cache
+from nose import SkipTest
+from webtest import TestApp
+
+if 'ext:memcached' not in clsmap:
+    raise SkipTest("'memcache' or 'cmemcache' is not installed, can't test "
+                   "memcached backend")
 
 mc_url = '127.0.0.1'
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.