node-postgres/test/unit/client/cleartext-password-tests.js
2010-10-24 22:52:12 -05:00

17 lines
478 B
JavaScript

require(__dirname+'/test-helper');
test('cleartext password authentication', function(){
var client = createClient();
client.password = "!";
client.connection.stream.packets = [];
client.connection.emit('authenticationCleartextPassword');
test('responds with password', function() {
var packets = client.connection.stream.packets;
assert.length(packets, 1);
var packet = packets[0];
assert.equalBuffers(packet, [0x70, 0, 0, 0, 6, 33, 0]);
});
});