2017-07-03 06:42:34 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2017-07-07 05:42:04 +00:00
|
|
|
"time"
|
2017-07-03 06:42:34 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestZeroConfig(t *testing.T) {
|
|
|
|
assert := assert.New(t)
|
|
|
|
|
|
|
|
cfg := Config{}
|
2017-07-07 05:42:04 +00:00
|
|
|
assert.Equal(cfg.expiry, 0*time.Second)
|
2017-07-03 06:42:34 +00:00
|
|
|
assert.Equal(cfg.fqdn, "")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestConfig(t *testing.T) {
|
|
|
|
assert := assert.New(t)
|
|
|
|
|
2017-07-07 05:42:04 +00:00
|
|
|
cfg := Config{expiry: 30 * time.Minute, fqdn: "https://localhost"}
|
|
|
|
assert.Equal(cfg.expiry, 30*time.Minute)
|
2017-07-03 06:42:34 +00:00
|
|
|
assert.Equal(cfg.fqdn, "https://localhost")
|
|
|
|
}
|