示例#1
0
    def test_get_connection(self):
        from stubo.model.db import get_connection

        conn = get_connection({'host': 'localhost', 'max_pool_size': 20, 'port': 27017})
        self.assertEqual(conn.host, 'localhost')
        self.assertEqual(conn.port, 27017)
        self.assertEqual(conn.max_pool_size, 20)
示例#2
0
 def test_get_connection(self):
     from stubo.model.db import get_connection
     conn = get_connection({
         'host': 'localhost',
         'max_pool_size': 20,
         'port': 27017
     })
     self.assertEqual(conn.host, 'localhost')
     self.assertEqual(conn.port, 27017)
     self.assertEqual(conn.max_pool_size, 20)
示例#3
0
    def test_get_connection_with_db(self):
        from stubo.model.db import get_connection, default_env

        conn = get_connection()
        self.assertEqual(conn.name, default_env['db'])
示例#4
0
    def test_get_connection_with_db(self):
        from stubo.model.db import get_connection, default_env

        conn = get_connection()
        self.assertEqual(conn.name, default_env['db'])