Tests: Add unit tests
This commit is contained in:
parent
ba612f6619
commit
afe2190797
4 changed files with 54 additions and 0 deletions
13
internal/config/options_report_test.go
Normal file
13
internal/config/options_report_test.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestOptions_Report(t *testing.T) {
|
||||
m := Options{}
|
||||
r, _ := m.Report()
|
||||
assert.GreaterOrEqual(t, len(r), 1)
|
||||
}
|
13
internal/config/report_test.go
Normal file
13
internal/config/report_test.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestConfig_Report(t *testing.T) {
|
||||
m := NewConfig(CliTestContext())
|
||||
r, _ := m.Report()
|
||||
assert.GreaterOrEqual(t, len(r), 1)
|
||||
}
|
12
pkg/colors/profiles_test.go
Normal file
12
pkg/colors/profiles_test.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package colors
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestProfile_Equal(t *testing.T) {
|
||||
assert.True(t, ProfileDisplayP3.Equal("Display P3"))
|
||||
assert.False(t, ProfileDisplayP3.Equal(""))
|
||||
}
|
16
pkg/media/report_test.go
Normal file
16
pkg/media/report_test.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package media
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/photoprism/photoprism/pkg/fs"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestReport(t *testing.T) {
|
||||
m := fs.Extensions.Types(true)
|
||||
r, _ := Report(m, true, true, true)
|
||||
assert.GreaterOrEqual(t, len(r), 1)
|
||||
r2, _ := Report(m, false, true, true)
|
||||
assert.GreaterOrEqual(t, len(r2), 1)
|
||||
}
|
Loading…
Reference in a new issue