mirror of
https://github.com/photoprism/photoprism.git
synced 2025-09-27 13:13:32 +08:00
31 lines
778 B
Go
31 lines
778 B
Go
package commands
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAuthShowCommand(t *testing.T) {
|
|
t.Run("All", func(t *testing.T) {
|
|
// Run command with test context.
|
|
output, err := RunWithTestContext(AuthShowCommand, []string{"show", "sess34q3hael"})
|
|
|
|
// Check command output for plausibility.
|
|
// t.Logf(output)
|
|
assert.NoError(t, err)
|
|
assert.Contains(t, output, "alice")
|
|
assert.Contains(t, output, "access_token")
|
|
assert.Contains(t, output, "Client")
|
|
})
|
|
t.Run("NoResult", func(t *testing.T) {
|
|
// Run command with test context.
|
|
output, err := RunWithTestContext(AuthShowCommand, []string{"show", "sess34qxxxxx"})
|
|
|
|
// Check command output for plausibility.
|
|
// t.Logf(output)
|
|
assert.Error(t, err)
|
|
assert.Empty(t, output)
|
|
})
|
|
}
|