d6b810de47
- Add edit command with flag-based and interactive update modes - Add delete command with confirmation prompt and --force flag - Include delete alias 'rm' for convenience - Add comprehensive tests for both commands - Update project state documentation
35 lines
717 B
Go
35 lines
717 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestDeleteCommandExists(t *testing.T) {
|
|
if deleteCmd == nil {
|
|
t.Fatal("deleteCmd should not be nil")
|
|
}
|
|
|
|
if deleteCmd.Use != "delete <host-name-or-id>" {
|
|
t.Errorf("expected Use 'delete <host-name-or-id>', got '%s'", deleteCmd.Use)
|
|
}
|
|
|
|
if deleteCmd.Short == "" {
|
|
t.Error("Short description should not be empty")
|
|
}
|
|
}
|
|
|
|
func TestDeleteCommandFlags(t *testing.T) {
|
|
expectedFlags := []string{"force"}
|
|
for _, flagName := range expectedFlags {
|
|
if deleteCmd.Flags().Lookup(flagName) == nil {
|
|
t.Errorf("flag '%s' should be defined", flagName)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestDeleteArgs(t *testing.T) {
|
|
if deleteCmd.Args == nil {
|
|
t.Error("Args validator should not be nil")
|
|
}
|
|
}
|