mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 02:35:54 +02:00
Fix trailing whitespace in code review feedback
Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
This commit is contained in:
28
internal/embeddedpg/embeddedpg_test.go
Normal file
28
internal/embeddedpg/embeddedpg_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package embeddedpg
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestInitialize(t *testing.T) {
|
||||
workDir := "/tmp/gogs-test"
|
||||
pg := Initialize(workDir)
|
||||
|
||||
assert.NotNil(t, pg)
|
||||
assert.Equal(t, filepath.Join(workDir, "data", "local-postgres"), pg.baseDir)
|
||||
assert.Equal(t, uint32(15432), pg.tcpPort)
|
||||
assert.Equal(t, "gogs", pg.database)
|
||||
assert.Equal(t, "gogs", pg.user)
|
||||
assert.Equal(t, "gogs", pg.pass)
|
||||
}
|
||||
|
||||
func TestShutdownWithoutStart(t *testing.T) {
|
||||
pg := Initialize("/tmp/gogs-test")
|
||||
|
||||
// Should not error when stopping a non-started instance
|
||||
err := pg.Shutdown()
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
Reference in New Issue
Block a user