mirror of
https://github.com/smallstep/certificates.git
synced 2024-11-03 23:15:28 +00:00
30 lines
726 B
Go
30 lines
726 B
Go
package provisioner
|
|
|
|
import (
|
|
"context"
|
|
"crypto/x509"
|
|
"testing"
|
|
|
|
"github.com/smallstep/assert"
|
|
)
|
|
|
|
func Test_noop(t *testing.T) {
|
|
p := noop{}
|
|
assert.Equals(t, "noop", p.GetID())
|
|
assert.Equals(t, "noop", p.GetName())
|
|
assert.Equals(t, noopType, p.GetType())
|
|
assert.Equals(t, nil, p.Init(Config{}))
|
|
assert.Equals(t, nil, p.AuthorizeRenewal(&x509.Certificate{}))
|
|
assert.Equals(t, nil, p.AuthorizeRevoke("foo"))
|
|
|
|
kid, key, ok := p.GetEncryptedKey()
|
|
assert.Equals(t, "", kid)
|
|
assert.Equals(t, "", key)
|
|
assert.Equals(t, false, ok)
|
|
|
|
ctx := NewContextWithMethod(context.Background(), SignMethod)
|
|
sigOptions, err := p.AuthorizeSign(ctx, "foo")
|
|
assert.Equals(t, []SignOption{}, sigOptions)
|
|
assert.Equals(t, nil, err)
|
|
}
|