34 lines
546 B
Go
34 lines
546 B
Go
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
|
|
|
package config
|
|
|
|
import (
|
|
"context"
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
"fmt"
|
|
)
|
|
|
|
func TestNewOpenPGPSignatureConfig(t *testing.T) {
|
|
p := NewOpenPGPSignature()
|
|
assert.NotNil(t, p)
|
|
}
|
|
|
|
func TestNewOpenPGPSignatureConfigYAML(t *testing.T) {
|
|
p := NewOpenPGPSignature()
|
|
assert.NotNil(t, p)
|
|
|
|
|
|
|
|
config := fmt.Sprintf(`
|
|
keyring: |-
|
|
%s
|
|
%s
|
|
`, publicKey, privateKey)
|
|
|
|
yamlErr := p.LoadYAML(config)
|
|
assert.Nil(t, yamlErr)
|
|
|
|
p.Read(context.Background())
|
|
}
|