MCPcopy Create free account
hub / github.com/UiPath/uipathcli / MultipleArgumentsArray

Function MultipleArgumentsArray

test/execution_test.go:448–480  ·  view source on GitHub ↗
(t *testing.T, itemsType string, arguments []string, pathValue string)

Source from the content-addressed store, hash-verified

446}
447
448func MultipleArgumentsArray(t *testing.T, itemsType string, arguments []string, pathValue string) {
449 definition := `
450paths:
451 /ping/{ids}:
452 parameters:
453 - name: ids
454 in: path
455 required: true
456 description: The ids
457 schema:
458 type: array
459 items:
460 type: ` + itemsType + `
461 get:
462 operationId: ping
463 summary: Simple ping
464`
465 context := NewContextBuilder().
466 WithResponse(http.StatusOK, "{}").
467 WithDefinition("myservice", definition).
468 Build()
469
470 args := []string{"myservice", "ping"}
471 for _, arg := range arguments {
472 args = append(args, "--ids", arg)
473 }
474 result := RunCli(args, context)
475
476 expected := "/ping/" + pathValue
477 if result.RequestUrl != expected {
478 t.Errorf("Invalid request url, expected: %v, got: %v", expected, result.RequestUrl)
479 }
480}
481
482func TestRequestWithHeaderParameterArray(t *testing.T) {
483 t.Run("StringArray", func(t *testing.T) {

Callers 1

Calls 5

NewContextBuilderFunction · 0.85
RunCliFunction · 0.85
WithDefinitionMethod · 0.80
WithResponseMethod · 0.80
BuildMethod · 0.45

Tested by

no test coverage detected