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

Function CommaSeparatedArrayArgument

test/execution_test.go:403–431  ·  view source on GitHub ↗
(t *testing.T, itemsType string, argument string, pathValue string)

Source from the content-addressed store, hash-verified

401}
402
403func CommaSeparatedArrayArgument(t *testing.T, itemsType string, argument string, pathValue string) {
404 definition := `
405paths:
406 /ping/{ids}:
407 parameters:
408 - name: ids
409 in: path
410 required: true
411 description: The ids
412 schema:
413 type: array
414 items:
415 type: ` + itemsType + `
416 get:
417 operationId: ping
418 summary: Simple ping
419`
420 context := NewContextBuilder().
421 WithResponse(http.StatusOK, "{}").
422 WithDefinition("myservice", definition).
423 Build()
424
425 result := RunCli([]string{"myservice", "ping", "--ids", argument}, context)
426
427 expected := "/ping/" + pathValue
428 if result.RequestUrl != expected {
429 t.Errorf("Invalid request url, expected: %v, got: %v", expected, result.RequestUrl)
430 }
431}
432
433func TestMultipleArgumentsArray(t *testing.T) {
434 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