photoprism/internal/event/audit_test.go
Michael Mayer f5a8c5a45d Auth: Session and ACL enhancements #98 #1746
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-28 09:01:17 +02:00

22 lines
520 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package event
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/photoprism/photoprism/pkg/clean"
)
func TestFormat(t *testing.T) {
assert.Equal(t, "", Format(nil))
assert.Equal(t, "user", Format([]string{"user"}))
assert.Equal(t, "user michael not found", Format([]string{"user", "michael", "not found"}))
result := Format([]string{"user", "%s not found"}, clean.LogQuote("michael"))
expected := "user 'michael' not found"
assert.Equal(t, expected, result)
t.Log(result)
}