From 9935c4984c754201fa6192da3d00ae6a95a8ed82 Mon Sep 17 00:00:00 2001 From: Mohamed Abdelnour Date: Sun, 30 May 2021 09:11:19 +0200 Subject: [PATCH] Add Robot Framework syntax test file --- ...recipe141_aws_simple_storage_service.robot | 31 +++++++++++++++++++ .../source/Robot Framework/LICENSE.md | 25 +++++++++++++++ ...recipe141_aws_simple_storage_service.robot | 31 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 tests/syntax-tests/highlighted/Robot Framework/recipe141_aws_simple_storage_service.robot create mode 100644 tests/syntax-tests/source/Robot Framework/LICENSE.md create mode 100644 tests/syntax-tests/source/Robot Framework/recipe141_aws_simple_storage_service.robot diff --git a/tests/syntax-tests/highlighted/Robot Framework/recipe141_aws_simple_storage_service.robot b/tests/syntax-tests/highlighted/Robot Framework/recipe141_aws_simple_storage_service.robot new file mode 100644 index 00000000..6f22031a --- /dev/null +++ b/tests/syntax-tests/highlighted/Robot Framework/recipe141_aws_simple_storage_service.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation PROBLEM: +... You want to test the existence of a file in an AWS S3 bucket +... without using lower level Python code or developing a custom library. +... DISCUSSION: +... This recipe demonstrates: +... - using a Suite Teardown to end the test suite cleanly +... - using keywords from an external library +... - accessing OS Environment Variables directly using %{} syntax +... This recipe has the following external dependencies: +... $ pip install --upgrade robotframework-aws +... This recipe also requires the following OS environment variables: +... AWS_ACCESS_KEY_ID +... AWS_SECRET_ACCESS_KEY +Suite Teardown  Delete All Sessions +Library  AWSLibrary +Force Tags  no-ci-testing + +*** Variables *** +${recipe} Recipe 14.1 AWS Simple Storage Service +${level} Intermediate +${category} External Library: AWSLibrary +${REGION} us-east-1 +${BUCKET} YOUR_BUCKET_NAME_GOES_HERE +${KEY} YOUR_FILE_PATH_GOES_HERE + +*** Test Cases *** +Check Key Exists In Bucket + Log Variables + Create Session With Keys ${REGION} %{AWS_ACCESS_KEY_ID} %{AWS_SECRET_ACCESS_KEY} + Key Should Exist ${BUCKET} ${KEY} diff --git a/tests/syntax-tests/source/Robot Framework/LICENSE.md b/tests/syntax-tests/source/Robot Framework/LICENSE.md new file mode 100644 index 00000000..59741cee --- /dev/null +++ b/tests/syntax-tests/source/Robot Framework/LICENSE.md @@ -0,0 +1,25 @@ +The `recipe141_aws_simple_storage_service.robot` file has been added from https://github.com/adrianyorke/robotframework-cookbook under the following license: + +```text +MIT License + +Copyright (c) 2020 Adrian Yorke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/tests/syntax-tests/source/Robot Framework/recipe141_aws_simple_storage_service.robot b/tests/syntax-tests/source/Robot Framework/recipe141_aws_simple_storage_service.robot new file mode 100644 index 00000000..2c446b40 --- /dev/null +++ b/tests/syntax-tests/source/Robot Framework/recipe141_aws_simple_storage_service.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation PROBLEM: +... You want to test the existence of a file in an AWS S3 bucket +... without using lower level Python code or developing a custom library. +... DISCUSSION: +... This recipe demonstrates: +... - using a Suite Teardown to end the test suite cleanly +... - using keywords from an external library +... - accessing OS Environment Variables directly using %{} syntax +... This recipe has the following external dependencies: +... $ pip install --upgrade robotframework-aws +... This recipe also requires the following OS environment variables: +... AWS_ACCESS_KEY_ID +... AWS_SECRET_ACCESS_KEY +Suite Teardown Delete All Sessions +Library AWSLibrary +Force Tags no-ci-testing + +*** Variables *** +${recipe} Recipe 14.1 AWS Simple Storage Service +${level} Intermediate +${category} External Library: AWSLibrary +${REGION} us-east-1 +${BUCKET} YOUR_BUCKET_NAME_GOES_HERE +${KEY} YOUR_FILE_PATH_GOES_HERE + +*** Test Cases *** +Check Key Exists In Bucket + Log Variables + Create Session With Keys ${REGION} %{AWS_ACCESS_KEY_ID} %{AWS_SECRET_ACCESS_KEY} + Key Should Exist ${BUCKET} ${KEY}