Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test #4

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
387 changes: 387 additions & 0 deletions libs/partners/robocorp/tests/unit_tests/_openapi2.fixture.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
{
"openapi": "3.1.0",
"info": {
"title": "Robocorp Action Server",
"version": "0.1.0"
},
"servers": [
{
"url": "https://hosted-actions.onrender.com"
}
],
"paths": {
"/api/actions/google-sheet-gmail/get-google-spreadsheet-schema/run": {
"post": {
"summary": "Get Google Spreadsheet Schema",
"description": "Action to get necessary information to be able to work with a Google Sheet Spreadsheets correctly.\nUse this action minimum once before anything else, to learn about the structure\nof the Spreadsheet. Method will return the first few rows of each Sheet as an example.",
"operationId": "get_google_spreadsheet_schema",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {},
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "string",
"title": "Response Get Google Spreadsheet Schema",
"description": "Names of the sheets, and a couple of first rows from each sheet to explain the context."
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/actions/google-sheet-gmail/create-new-google-sheet/run": {
"post": {
"summary": "Create New Google Sheet",
"description": "Creates a new empty Sheet in user's Google Spreadsheet.",
"operationId": "create_new_google_sheet",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"name": {
"type": "string",
"title": "Name",
"description": "Name of the Sheet. You must refer to this Sheet name later when adding or reading date from the Sheet."
}
},
"type": "object",
"required": [
"name"
]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "string",
"title": "Response Create New Google Sheet",
"description": "True if operation was success, and False if it failed."
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/actions/google-sheet-gmail/add-sheet-rows/run": {
"post": {
"summary": "Add Sheet Rows",
"description": "Action to add multiple rows to the Google sheet. Get the sheets with get_google_spreadsheet_schema if you don't know\nthe names or data structure. Make sure the values are in correct columns (needs to be ordered the same as in the sample).\nStrictly adhere to the schema.",
"operationId": "add_sheet_rows",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"sheet": {
"type": "string",
"title": "Sheet",
"description": "Name of the sheet where the data is added to"
},
"rows_to_add": {
"properties": {
"rows": {
"items": {
"properties": {
"columns": {
"items": {
"type": "string"
},
"type": "array",
"title": "Columns",
"description": "The columns that make up the row"
}
},
"type": "object",
"required": [
"columns"
],
"title": "Row"
},
"type": "array",
"title": "Rows",
"description": "The rows that need to be added"
}
},
"type": "object",
"required": [
"rows"
],
"title": "Rows To Add",
"description": "the rows to be added to the sheet"
}
},
"type": "object",
"required": [
"sheet",
"rows_to_add"
]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "string",
"title": "Response Add Sheet Rows",
"description": "The result of the operation."
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/actions/google-sheet-gmail/get-sheet-contents/run": {
"post": {
"summary": "Get Sheet Contents",
"description": "Get all content from the chosen Google Spreadsheet Sheet.",
"operationId": "get_sheet_contents",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"sheet": {
"type": "string",
"title": "Sheet",
"description": "Name of the sheet from which to get the data"
}
},
"type": "object",
"required": [
"sheet"
]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "string",
"title": "Response Get Sheet Contents",
"description": "Sheet data as string, rows separated by newlines"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/actions/google-sheet-gmail/send-email-via-gmail/run": {
"post": {
"summary": "Send Email Via Gmail",
"description": "Sends an email using Gmail SMTP with an App Password for authentication.",
"operationId": "send_email_via_gmail",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"subject": {
"type": "string",
"title": "Subject",
"description": "Email subject"
},
"body": {
"type": "string",
"title": "Body",
"description": "Email body content"
},
"recipient": {
"type": "string",
"title": "Recipient",
"description": "Recipient email address"
}
},
"type": "object",
"required": [
"subject",
"body",
"recipient"
]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "string",
"title": "Response Send Email Via Gmail",
"description": "Information if the send was successfull or not"

Check failure on line 306 in libs/partners/robocorp/tests/unit_tests/_openapi2.fixture.json

View workflow job for this annotation

GitHub Actions / (Check for spelling errors)

successfull ==> successful
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
],
"x-openai-isConsequential": true
}
}
},
"components": {
"securitySchemes": {
"HTTPBearer": {
"type": "http",
"scheme": "bearer"
}
},
"schemas": {
"HTTPValidationError": {
"properties": {
"errors": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Errors"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
}
}
1 change: 1 addition & 0 deletions libs/partners/robocorp/tests/unit_tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ def test_reduce_openapi_spec(self) -> None:

self.assertEqual(len(output.endpoints), 8)
self.assertEqual(output.endpoints[0][1], openapi_endpoint_doc_mock)

Loading
Loading