kinesis-consumer/s3_key_test.go
Harlow Ward f0e6461cb6 Refactor to use handler func
The previous pipeline model required a lot of setup and abstracted away
the processing of records. By passing a HandlerFunc to the consumer we
keep the business logic of processing of records closer to the use of
the consumer.

* Add refactoring note and SHA to README
2016-02-06 17:50:17 -08:00

19 lines
325 B
Go

package connector
import (
"fmt"
"testing"
"time"
"github.com/bmizerany/assert"
)
func Test_S3Key(t *testing.T) {
d := time.Now().UTC().Format("2006/01/02")
k := S3Key("", "a", "b")
assert.Equal(t, k, fmt.Sprintf("%v/a-b", d))
k = S3Key("prefix", "a", "b")
assert.Equal(t, k, fmt.Sprintf("prefix/%v/a-b", d))
}