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

Function RequestWithPathParameterDataType

test/execution_test.go:579–605  ·  view source on GitHub ↗
(t *testing.T, datatype string, argument string, value string)

Source from the content-addressed store, hash-verified

577}
578
579func RequestWithPathParameterDataType(t *testing.T, datatype string, argument string, value string) {
580 definition := `
581paths:
582 /ping/{id}:
583 parameters:
584 - name: id
585 in: path
586 required: true
587 description: The id
588 schema:
589 type: ` + datatype + `
590 get:
591 operationId: ping
592 summary: Simple ping
593`
594 context := NewContextBuilder().
595 WithResponse(http.StatusOK, "{}").
596 WithDefinition("myservice", definition).
597 Build()
598
599 result := RunCli([]string{"myservice", "ping", "--id", argument}, context)
600
601 expected := `/ping/` + value
602 if result.RequestUrl != expected {
603 t.Errorf("Invalid request url, expected: %v, got: %v", expected, result.RequestUrl)
604 }
605}
606
607func TestRequestWithQueryStringDataTypes(t *testing.T) {
608 t.Run("String", func(t *testing.T) { RequestWithQueryStringDataTypes(t, "string", "myvalue", "myvalue") })

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