mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
CLI: Upgrade github.com/urfave/cli from v1 to v2 #3168
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -8,18 +8,21 @@ import (
|
||||
)
|
||||
|
||||
func TestVersionCommand(t *testing.T) {
|
||||
var err error
|
||||
t.Run("Success", func(t *testing.T) {
|
||||
var err error
|
||||
|
||||
// Create test context with flags and arguments.
|
||||
ctx := NewTestContext([]string{""})
|
||||
// Create test context with flags and arguments.
|
||||
args := []string{"version"}
|
||||
ctx := NewTestContext(args)
|
||||
|
||||
// Run command with test context.
|
||||
output := capture.Output(func() {
|
||||
err = VersionCommand.Run(ctx)
|
||||
// Run command with test context.
|
||||
output := capture.Output(func() {
|
||||
err = VersionCommand.Run(ctx, args...)
|
||||
})
|
||||
|
||||
// Check command output for plausibility.
|
||||
// t.Logf(output)
|
||||
assert.NoError(t, err)
|
||||
assert.Contains(t, output, "test")
|
||||
})
|
||||
|
||||
// Check command output for plausibility.
|
||||
// t.Logf(output)
|
||||
assert.NoError(t, err)
|
||||
assert.Contains(t, output, "test")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user