kinesis-consumer/emitter/s3/key_test.go

20 lines
312 B
Go
Raw Normal View History

2016-02-09 03:39:09 +00:00
package s3
import (
"fmt"
"testing"
"time"
"github.com/bmizerany/assert"
)
2016-02-09 03:39:09 +00:00
func Test_Key(t *testing.T) {
d := time.Now().UTC().Format("2006/01/02")
2016-02-09 03:39:09 +00:00
k := Key("", "a", "b")
assert.Equal(t, k, fmt.Sprintf("%v/a-b", d))
2016-02-09 03:39:09 +00:00
k = Key("prefix", "a", "b")
assert.Equal(t, k, fmt.Sprintf("prefix/%v/a-b", d))
}