(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestCreateCmd_CommandStructure(t *testing.T) { |
| 18 | // Cleanup. |
| 19 | dirs.RemoveAllForTest() |
| 20 | |
| 21 | celer := configs.NewCeler() |
| 22 | createCmd := createCmd{} |
| 23 | cmd := createCmd.Command(celer) |
| 24 | |
| 25 | t.Run("command_structure", func(t *testing.T) { |
| 26 | if cmd.Use != "create" { |
| 27 | t.Errorf("Expected Use to be 'create', got '%s'", cmd.Use) |
| 28 | } |
| 29 | |
| 30 | if cmd.Short == "" { |
| 31 | t.Error("Short description should not be empty") |
| 32 | } |
| 33 | |
| 34 | if cmd.Long == "" { |
| 35 | t.Error("Long description should not be empty") |
| 36 | } |
| 37 | |
| 38 | // Check flags exist |
| 39 | flags := []string{"platform", "project", "port"} |
| 40 | for _, flagName := range flags { |
| 41 | if cmd.Flags().Lookup(flagName) == nil { |
| 42 | t.Errorf("--%s flag should be defined", flagName) |
| 43 | } |
| 44 | } |
| 45 | }) |
| 46 | |
| 47 | t.Run("mutually_exclusive_flags", func(t *testing.T) { |
| 48 | // This test verifies that the flags are properly marked as mutually exclusive, |
| 49 | // The actual enforcement is handled by Cobra during command execution. |
| 50 | flagNames := []string{"platform", "project", "port"} |
| 51 | for _, flagName := range flagNames { |
| 52 | if cmd.Flags().Lookup(flagName) == nil { |
| 53 | t.Errorf("Flag %s should exist", flagName) |
| 54 | } |
| 55 | } |
| 56 | }) |
| 57 | } |
| 58 | |
| 59 | func TestCreateCmd_Completion(t *testing.T) { |
| 60 | // Cleanup. |
nothing calls this directly
no test coverage detected