mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
add unittest for mockCert()
This commit is contained in:
parent
0bfc7775fb
commit
5ecb63426f
1 changed files with 17 additions and 0 deletions
17
server/certificates/mock_test.go
Normal file
17
server/certificates/mock_test.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package certificates
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"codeberg.org/codeberg/pages/server/database"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMockCert(t *testing.T) {
|
||||
db, err := database.NewTmpDB()
|
||||
assert.NoError(t, err)
|
||||
cert := mockCert("example.com", "some error msg", "codeberg.page", db)
|
||||
if assert.NotEmpty(t, cert) {
|
||||
assert.NotEmpty(t, cert.Certificate)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue