Пример #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'])