R echo client tests (#17629)

* add r echo api client sample

* add r workflow

* fix

* add env

* set r version

* install curl

* install dep

* fix

* comment out installation
This commit is contained in:
William Cheng
2024-01-18 09:05:35 +08:00
committed by GitHub
parent eab34c9b3f
commit d810d7c534
69 changed files with 8498 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
library(testthat)
library(openapi)
test_check("openapi")

View File

@@ -0,0 +1,28 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test AuthApi")
api_instance <- AuthApi$new()
test_that("TestAuthHttpBasic", {
# tests for TestAuthHttpBasic
# base path: http://localhost:3000
# To test HTTP basic authentication
# To test HTTP basic authentication
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestAuthHttpBearer", {
# tests for TestAuthHttpBearer
# base path: http://localhost:3000
# To test HTTP bearer authentication
# To test HTTP bearer authentication
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,20 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test Bird")
model_instance <- Bird$new()
test_that("size", {
# tests for the property `size` (character)
# uncomment below to test the property
#expect_equal(model.instance$`size`, "EXPECTED_RESULT")
})
test_that("color", {
# tests for the property `color` (character)
# uncomment below to test the property
#expect_equal(model.instance$`color`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,113 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test BodyApi")
api_instance <- BodyApi$new()
test_that("TestBinaryGif", {
# tests for TestBinaryGif
# base path: http://localhost:3000
# Test binary (gif) response body
# Test binary (gif) response body
# @return [data.frame]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestBodyApplicationOctetstreamBinary", {
# tests for TestBodyApplicationOctetstreamBinary
# base path: http://localhost:3000
# Test body parameter(s)
# Test body parameter(s)
# @param body data.frame (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestBodyMultipartFormdataArrayOfBinary", {
# tests for TestBodyMultipartFormdataArrayOfBinary
# base path: http://localhost:3000
# Test array of binary in multipart mime
# Test array of binary in multipart mime
# @param files array[data.frame]
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestBodyMultipartFormdataSingleBinary", {
# tests for TestBodyMultipartFormdataSingleBinary
# base path: http://localhost:3000
# Test single binary in multipart mime
# Test single binary in multipart mime
# @param my_file data.frame (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestEchoBodyAllOfPet", {
# tests for TestEchoBodyAllOfPet
# base path: http://localhost:3000
# Test body parameter(s)
# Test body parameter(s)
# @param pet Pet Pet object that needs to be added to the store (optional)
# @return [Pet]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestEchoBodyFreeFormObjectResponseString", {
# tests for TestEchoBodyFreeFormObjectResponseString
# base path: http://localhost:3000
# Test free form object
# Test free form object
# @param body object Free form object (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestEchoBodyPet", {
# tests for TestEchoBodyPet
# base path: http://localhost:3000
# Test body parameter(s)
# Test body parameter(s)
# @param pet Pet Pet object that needs to be added to the store (optional)
# @return [Pet]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestEchoBodyPetResponseString", {
# tests for TestEchoBodyPetResponseString
# base path: http://localhost:3000
# Test empty response body
# Test empty response body
# @param pet Pet Pet object that needs to be added to the store (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestEchoBodyTagResponseString", {
# tests for TestEchoBodyTagResponseString
# base path: http://localhost:3000
# Test empty json (request body)
# Test empty json (request body)
# @param tag Tag Tag object (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,20 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test Category")
model_instance <- Category$new()
test_that("id", {
# tests for the property `id` (integer)
# uncomment below to test the property
#expect_equal(model.instance$`id`, "EXPECTED_RESULT")
})
test_that("name", {
# tests for the property `name` (character)
# uncomment below to test the property
#expect_equal(model.instance$`name`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,45 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test DataQuery")
model_instance <- DataQuery$new()
test_that("id", {
# tests for the property `id` (integer)
# Query
# uncomment below to test the property
#expect_equal(model.instance$`id`, "EXPECTED_RESULT")
})
test_that("outcomes", {
# tests for the property `outcomes` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`outcomes`, "EXPECTED_RESULT")
})
test_that("suffix", {
# tests for the property `suffix` (character)
# test suffix
# uncomment below to test the property
#expect_equal(model.instance$`suffix`, "EXPECTED_RESULT")
})
test_that("text", {
# tests for the property `text` (character)
# Some text containing white spaces
# uncomment below to test the property
#expect_equal(model.instance$`text`, "EXPECTED_RESULT")
})
test_that("date", {
# tests for the property `date` (character)
# A date
# uncomment below to test the property
#expect_equal(model.instance$`date`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,62 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test DefaultValue")
model_instance <- DefaultValue$new()
test_that("array_string_enum_ref_default", {
# tests for the property `array_string_enum_ref_default` (array[StringEnumRef])
# uncomment below to test the property
#expect_equal(model.instance$`array_string_enum_ref_default`, "EXPECTED_RESULT")
})
test_that("array_string_enum_default", {
# tests for the property `array_string_enum_default` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`array_string_enum_default`, "EXPECTED_RESULT")
})
test_that("array_string_default", {
# tests for the property `array_string_default` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`array_string_default`, "EXPECTED_RESULT")
})
test_that("array_integer_default", {
# tests for the property `array_integer_default` (array[integer])
# uncomment below to test the property
#expect_equal(model.instance$`array_integer_default`, "EXPECTED_RESULT")
})
test_that("array_string", {
# tests for the property `array_string` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`array_string`, "EXPECTED_RESULT")
})
test_that("array_string_nullable", {
# tests for the property `array_string_nullable` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`array_string_nullable`, "EXPECTED_RESULT")
})
test_that("array_string_extension_nullable", {
# tests for the property `array_string_extension_nullable` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`array_string_extension_nullable`, "EXPECTED_RESULT")
})
test_that("string_nullable", {
# tests for the property `string_nullable` (character)
# uncomment below to test the property
#expect_equal(model.instance$`string_nullable`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,37 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test FormApi")
api_instance <- FormApi$new()
test_that("TestFormIntegerBooleanString", {
# tests for TestFormIntegerBooleanString
# base path: http://localhost:3000
# Test form parameter(s)
# Test form parameter(s)
# @param integer_form integer (optional)
# @param boolean_form character (optional)
# @param string_form character (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestFormOneof", {
# tests for TestFormOneof
# base path: http://localhost:3000
# Test form parameter(s) for oneOf schema
# Test form parameter(s) for oneOf schema
# @param form1 character (optional)
# @param form2 integer (optional)
# @param form3 character (optional)
# @param form4 character (optional)
# @param id integer (optional)
# @param name character (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,22 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test HeaderApi")
api_instance <- HeaderApi$new()
test_that("TestHeaderIntegerBooleanStringEnums", {
# tests for TestHeaderIntegerBooleanStringEnums
# base path: http://localhost:3000
# Test header parameter(s)
# Test header parameter(s)
# @param integer_header integer (optional)
# @param boolean_header character (optional)
# @param string_header character (optional)
# @param enum_nonref_string_header character (optional)
# @param enum_ref_string_header StringEnumRef (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,27 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test NumberPropertiesOnly")
model_instance <- NumberPropertiesOnly$new()
test_that("number", {
# tests for the property `number` (numeric)
# uncomment below to test the property
#expect_equal(model.instance$`number`, "EXPECTED_RESULT")
})
test_that("float", {
# tests for the property `float` (numeric)
# uncomment below to test the property
#expect_equal(model.instance$`float`, "EXPECTED_RESULT")
})
test_that("double", {
# tests for the property `double` (numeric)
# uncomment below to test the property
#expect_equal(model.instance$`double`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,21 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test PathApi")
api_instance <- PathApi$new()
test_that("TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath", {
# tests for TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath
# base path: http://localhost:3000
# Test path parameter(s)
# Test path parameter(s)
# @param path_string character
# @param path_integer integer
# @param enum_nonref_string_path character
# @param enum_ref_string_path StringEnumRef
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,49 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test Pet")
model_instance <- Pet$new()
test_that("id", {
# tests for the property `id` (integer)
# uncomment below to test the property
#expect_equal(model.instance$`id`, "EXPECTED_RESULT")
})
test_that("name", {
# tests for the property `name` (character)
# uncomment below to test the property
#expect_equal(model.instance$`name`, "EXPECTED_RESULT")
})
test_that("category", {
# tests for the property `category` (Category)
# uncomment below to test the property
#expect_equal(model.instance$`category`, "EXPECTED_RESULT")
})
test_that("photoUrls", {
# tests for the property `photoUrls` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`photoUrls`, "EXPECTED_RESULT")
})
test_that("tags", {
# tests for the property `tags` (array[Tag])
# uncomment below to test the property
#expect_equal(model.instance$`tags`, "EXPECTED_RESULT")
})
test_that("status", {
# tests for the property `status` (character)
# pet status in the store
# uncomment below to test the property
#expect_equal(model.instance$`status`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,21 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test Query")
model_instance <- Query$new()
test_that("id", {
# tests for the property `id` (integer)
# Query
# uncomment below to test the property
#expect_equal(model.instance$`id`, "EXPECTED_RESULT")
})
test_that("outcomes", {
# tests for the property `outcomes` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`outcomes`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,107 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test QueryApi")
api_instance <- QueryApi$new()
test_that("TestEnumRefString", {
# tests for TestEnumRefString
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param enum_nonref_string_query character (optional)
# @param enum_ref_string_query StringEnumRef (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestQueryDatetimeDateString", {
# tests for TestQueryDatetimeDateString
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param datetime_query character (optional)
# @param date_query character (optional)
# @param string_query character (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestQueryIntegerBooleanString", {
# tests for TestQueryIntegerBooleanString
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param integer_query integer (optional)
# @param boolean_query character (optional)
# @param string_query character (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestQueryStyleDeepObjectExplodeTrueObject", {
# tests for TestQueryStyleDeepObjectExplodeTrueObject
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param query_object Pet (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestQueryStyleDeepObjectExplodeTrueObjectAllOf", {
# tests for TestQueryStyleDeepObjectExplodeTrueObjectAllOf
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param query_object TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestQueryStyleFormExplodeTrueArrayString", {
# tests for TestQueryStyleFormExplodeTrueArrayString
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param query_object TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestQueryStyleFormExplodeTrueObject", {
# tests for TestQueryStyleFormExplodeTrueObject
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param query_object Pet (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})
test_that("TestQueryStyleFormExplodeTrueObjectAllOf", {
# tests for TestQueryStyleFormExplodeTrueObjectAllOf
# base path: http://localhost:3000
# Test query parameter(s)
# Test query parameter(s)
# @param query_object DataQuery (optional)
# @return [character]
# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,4 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test StringEnumRef")

View File

@@ -0,0 +1,20 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test Tag")
model_instance <- Tag$new()
test_that("id", {
# tests for the property `id` (integer)
# uncomment below to test the property
#expect_equal(model.instance$`id`, "EXPECTED_RESULT")
})
test_that("name", {
# tests for the property `name` (character)
# uncomment below to test the property
#expect_equal(model.instance$`name`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,34 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter")
model_instance <- TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter$new()
test_that("size", {
# tests for the property `size` (character)
# uncomment below to test the property
#expect_equal(model.instance$`size`, "EXPECTED_RESULT")
})
test_that("color", {
# tests for the property `color` (character)
# uncomment below to test the property
#expect_equal(model.instance$`color`, "EXPECTED_RESULT")
})
test_that("id", {
# tests for the property `id` (integer)
# uncomment below to test the property
#expect_equal(model.instance$`id`, "EXPECTED_RESULT")
})
test_that("name", {
# tests for the property `name` (character)
# uncomment below to test the property
#expect_equal(model.instance$`name`, "EXPECTED_RESULT")
})

View File

@@ -0,0 +1,13 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
context("Test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter")
model_instance <- TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter$new()
test_that("values", {
# tests for the property `values` (array[character])
# uncomment below to test the property
#expect_equal(model.instance$`values`, "EXPECTED_RESULT")
})