photoprism/internal/config/runtime_test.go
Michael Mayer 1c53a565a7 Configure on-demand rendering of regular thumbnail sizes #294
Can be enabled by setting PHOTOPRISM_RESAMPLE_UNCACHED to true

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-05 15:42:54 +02:00

34 lines
802 B
Go

package config
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewRuntimeInfo(t *testing.T) {
info := NewRuntimeInfo()
assert.LessOrEqual(t, 1, info.Cores)
assert.LessOrEqual(t, 1, info.Routines)
assert.LessOrEqual(t, uint64(1), info.Memory.Reserved)
assert.LessOrEqual(t, uint64(1), info.Memory.Used)
}
func TestRuntimeInfo_Refresh(t *testing.T) {
info := NewRuntimeInfo()
assert.LessOrEqual(t, 1, info.Cores)
assert.LessOrEqual(t, 1, info.Routines)
assert.LessOrEqual(t, uint64(1), info.Memory.Reserved)
assert.LessOrEqual(t, uint64(1), info.Memory.Used)
info.Refresh()
assert.LessOrEqual(t, 1, info.Cores)
assert.LessOrEqual(t, 1, info.Routines)
assert.LessOrEqual(t, uint64(1), info.Memory.Reserved)
assert.LessOrEqual(t, uint64(1), info.Memory.Used)
}