mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-18 10:29:43 +00:00
42b3f8d1b7
close #181 Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/185
21 lines
473 B
Go
21 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)
|
|
}
|
|
}
|