Permalink
Browse files

these should be functional only

otherwise they need to pass a fake connection somewhere.
  • Loading branch information...
1 parent 78c29d4 commit 32e21d4f60aa99e8bc1ad96b3b0f4a55e0730411 @reedobrien reedobrien committed Dec 8, 2012
Showing with 50 additions and 50 deletions.
  1. +50 −50 lumin/tests/test_db.py
View
@@ -2,56 +2,56 @@
import pyramid.testing
-from lumin.testing import Connection
-
-
-class TestConfiguration(unittest.TestCase):
- def setUp(self):
- self.config = pyramid.testing.setUp()
-
- def tearDown(self):
- pyramid.testing.tearDown()
-
- def _includelumin(self):
- import lumin
- self.config.include(lumin)
-
- def _registerdb(self):
- conn = Connection()
- self.config.registry.settings['mongodb.db_name'] = 'frozznob'
- self.config.register_mongodb(conn=conn)
-
- def test_register_mongodb_directive(self):
- self._includelumin()
-
- from lumin.db import IMongoDBConnection
- connection = self.config.registry.queryUtility(IMongoDBConnection)
- self.assertTrue(connection is None)
-
- # Now, let's register a database connection
- self._registerdb()
- connection = self.config.registry.queryUtility(IMongoDBConnection)
- self.assertTrue(connection is not None)
-
- def test_get_mongodb(self):
- self._includelumin()
- self._registerdb()
- from lumin.db import get_mongodb
- from pymongo.database import Database
- conn = get_mongodb(self.config.registry)
- self.assertTrue(isinstance(conn, Database))
-
- def test_add_mongodb(self):
- self._includelumin()
- self._registerdb()
- import pyramid
- request = pyramid.testing.DummyRequest(
- path='/',
- )
- import pyramid
- # fire an event to call add_mongodb
- self.config.registry.handle(pyramid.events.NewRequest(request))
- self.assertTrue(hasattr(request, 'db'))
+# from lumin.testing import Connection
+
+
+# class TestConfiguration(unittest.TestCase):
+# def setUp(self):
+# self.config = pyramid.testing.setUp()
+
+# def tearDown(self):
+# pyramid.testing.tearDown()
+
+# def _includelumin(self):
+# import lumin
+# self.config.include(lumin)
+
+# def _registerdb(self):
+# conn = Connection()
+# self.config.registry.settings['mongodb.db_name'] = 'frozznob'
+# self.config.register_mongodb(conn=conn)
+
+# def test_register_mongodb_directive(self):
+# self._includelumin()
+
+# from lumin.db import IMongoDBConnection
+# connection = self.config.registry.queryUtility(IMongoDBConnection)
+# self.assertTrue(connection is None)
+
+# # Now, let's register a database connection
+# self._registerdb()
+# connection = self.config.registry.queryUtility(IMongoDBConnection)
+# self.assertTrue(connection is not None)
+
+# def test_get_mongodb(self):
+# self._includelumin()
+# self._registerdb()
+# from lumin.db import get_mongodb
+# from pymongo.database import Database
+# conn = get_mongodb(self.config.registry)
+# self.assertTrue(isinstance(conn, Database))
+
+# def test_add_mongodb(self):
+# self._includelumin()
+# self._registerdb()
+# import pyramid
+# request = pyramid.testing.DummyRequest(
+# path='/',
+# )
+# import pyramid
+# # fire an event to call add_mongodb
+# self.config.registry.handle(pyramid.events.NewRequest(request))
+# self.assertTrue(hasattr(request, 'db'))
class TestIncludeMe(unittest.TestCase):

0 comments on commit 32e21d4

Please sign in to comment.