2018-10-24 21:42:33 +08:00
|
|
|
'use strict';
|
|
|
|
|
2018-07-20 18:04:06 +08:00
|
|
|
require('../helper');
|
|
|
|
const assert = require('assert');
|
|
|
|
|
2019-10-04 00:24:39 +08:00
|
|
|
const StreamCopy = require('../../lib/services/stream-copy');
|
2018-07-20 18:04:06 +08:00
|
|
|
|
|
|
|
describe('stream copy', function() {
|
|
|
|
it('uses batch api port', function(done) {
|
|
|
|
const userDbParams = {
|
|
|
|
dbname: 'cartodb_test_user_1_db',
|
|
|
|
dbuser: 'test_cartodb_user_1',
|
|
|
|
pass: 'test_cartodb_user_1_pass',
|
|
|
|
port: 'invalid_port'
|
|
|
|
};
|
|
|
|
const sql = 'COPY dummy_table FROM STDIN';
|
|
|
|
const streamCopy = new StreamCopy(sql, userDbParams);
|
2019-05-14 21:39:54 +08:00
|
|
|
assert.equal(streamCopy.dbParams.port, global.settings.db_batch_port);
|
2018-07-20 18:04:06 +08:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|