forked from mirror/pages-server
22 lines
473 B
Go
22 lines
473 B
Go
package certificates
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/mock"
|
|
|
|
"codeberg.org/codeberg/pages/server/database"
|
|
)
|
|
|
|
func TestMockCert(t *testing.T) {
|
|
db := database.NewMockCertDB(t)
|
|
db.Mock.On("Put", mock.Anything, mock.Anything).Return(nil)
|
|
|
|
cert, err := mockCert("example.com", "some error msg", "codeberg.page", db)
|
|
assert.NoError(t, err)
|
|
if assert.NotEmpty(t, cert) {
|
|
assert.NotEmpty(t, cert.Certificate)
|
|
}
|
|
}
|