mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
test for pool name caching
This commit is contained in:
parent
b18c981a82
commit
6c7b908367
32
test/integration/connection-pool/unique-name-tests.js
Normal file
32
test/integration/connection-pool/unique-name-tests.js
Normal file
@ -0,0 +1,32 @@
|
||||
var helper = require(__dirname + '/test-helper');
|
||||
|
||||
helper.pg.defaults.poolSize = 1;
|
||||
|
||||
var args = {
|
||||
user: helper.args.user,
|
||||
password: helper.args.password,
|
||||
database: helper.args.database,
|
||||
port: helper.args.port,
|
||||
host: helper.args.host
|
||||
}
|
||||
|
||||
helper.pg.connect(args, assert.calls(function(err, client) {
|
||||
assert.isNull(err);
|
||||
client.iGotAccessed = true;
|
||||
client.query("SELECT NOW()")
|
||||
}))
|
||||
|
||||
var moreArgs = {
|
||||
user: helper.args.user + "2",
|
||||
host: helper.args.host,
|
||||
password: helper.args.password,
|
||||
database: helper.args.database,
|
||||
port: helper.args.port,
|
||||
zomg: true
|
||||
}
|
||||
|
||||
helper.pg.connect(moreArgs, assert.calls(function(err, client) {
|
||||
assert.isNull(err);
|
||||
assert.ok(client.iGotAccessed === true)
|
||||
client.end();
|
||||
}))
|
||||
Loading…
x
Reference in New Issue
Block a user