Files
swanadiva d6b810de47 feat: implement edit and delete host commands
- 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
2026-06-23 13:52:10 +07:00

35 lines
774 B
Go

package main
import (
"testing"
)
func TestEditCommandExists(t *testing.T) {
if editCmd == nil {
t.Fatal("editCmd should not be nil")
}
if editCmd.Use != "edit <host-name-or-id>" {
t.Errorf("expected Use 'edit <host-name-or-id>', got '%s'", editCmd.Use)
}
if editCmd.Short == "" {
t.Error("Short description should not be empty")
}
}
func TestEditCommandFlags(t *testing.T) {
expectedFlags := []string{"host", "port", "user", "password", "key", "auth-type", "group", "tags", "notes", "name"}
for _, flagName := range expectedFlags {
if editCmd.Flags().Lookup(flagName) == nil {
t.Errorf("flag '%s' should be defined", flagName)
}
}
}
func TestEditArgs(t *testing.T) {
if editCmd.Args == nil {
t.Error("Args validator should not be nil")
}
}