forked from TrueCloudLab/certificates
Add noop tests.
This commit is contained in:
parent
4ceb88fbae
commit
5dfcbcf5dc
1 changed files with 27 additions and 0 deletions
27
authority/provisioner/noop_test.go
Normal file
27
authority/provisioner/noop_test.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package provisioner
|
||||
|
||||
import (
|
||||
"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)
|
||||
|
||||
sigOptions, err := p.Authorize("foo")
|
||||
assert.Equals(t, []SignOption{}, sigOptions)
|
||||
assert.Equals(t, nil, err)
|
||||
}
|
Loading…
Reference in a new issue