To allow for different logging endpoints we'll introduce a Logger interface that will be passed into the pipeline during initialization. * Add Logger interface * Use logger interface in pipeline and emitters
20 lines
453 B
Go
20 lines
453 B
Go
package connector
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCopyStatement(t *testing.T) {
|
|
e := RedshiftBasicEmitter{
|
|
Delimiter: ",",
|
|
S3Bucket: "test_bucket",
|
|
TableName: "test_table",
|
|
}
|
|
f := e.copyStatement("/test.txt")
|
|
|
|
copyStatement := "COPY test_table FROM 's3://test_bucket/test.txt' CREDENTIALS 'aws_access_key_id=;aws_secret_access_key=' DELIMITER ',';"
|
|
|
|
if f != copyStatement {
|
|
t.Errorf("copyStatement() = %s want %s", f, copyStatement)
|
|
}
|
|
}
|