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

Release/1.0.0 #61

Merged
merged 3 commits into from
Aug 23, 2024
Merged
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
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ Configure your environment as desired, the requirements are in the requirements.
pip install -r requirements.txt
```

### Keywords
All keyword names must start with the module name for easy searching in html documentation, example:
```robotframework
S3 Upload File
Sqs Send Message
CloudWatch Wait For Logs
Dynamo Query Table
```
### Versioning
From left to right. The first number is incremented every time a new AWS module is incorporated, that is,
when a new python file with a new class is incorporated into the project.

The second one is incremented every time a new keyword is added to the existing modules. (sqs, dynamo, s3...)

The last one is incremented by bugfix or code improvements.

## Testing

### Localstack
Expand Down
2 changes: 1 addition & 1 deletion docs/AWSLibrary.html

Large diffs are not rendered by default.

196 changes: 157 additions & 39 deletions docs/AWSLibrary.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="AWSLibrary" type="LIBRARY" format="ROBOT" scope="GLOBAL" generated="2024-06-20T16:01:35+00:00" specversion="6" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\__init__.py" lineno="14">
<version>0.2.0</version>
<keywordspec name="AWSLibrary" type="LIBRARY" format="ROBOT" scope="GLOBAL" generated="2024-08-23T13:36:10+00:00" specversion="6" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\__init__.py" lineno="14">
<version>1.0.0</version>
<doc>AWSLibrary is a testing library for Robot Framework that gives you the ability to use some of the AWS
services in your tests. This robot library is made from Boto3 SDK

Expand Down Expand Up @@ -85,7 +85,7 @@ appropriate URL to use when communicating with a service. You can specify a comp
| CloudWatch Set Endpoint Url | http://localhost:4566/ |</doc>
<shortdoc>The complete URL to use for the constructed CloudWatch client. Normally, botocore will automatically construct the appropriate URL to use when communicating with a service. You can specify a complete URL (including the “http/https” scheme) to override this behavior.</shortdoc>
</kw>
<kw name="CloudWatch Wait For Logs" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\cloudWatch.py" lineno="71">
<kw name="CloudWatch Wait For Logs" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\cloudWatch.py" lineno="72">
<arguments repr="log_group, filter_pattern, regex_pattern, seconds_behind=60, timeout=30, not_found_fail=False">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="log_group">
<name>log_group</name>
Expand Down Expand Up @@ -147,8 +147,8 @@ amount of log found, the keyword execution time may be slightly longer than the

*Examples:*
| ${logs} | CloudWatch Wait For Logs | /aws/group_name | {$.foo.bar = id_value} | 2024.*filename |
| ${logs} | CloudWatch Wait For Logs | /aws/group_name | INFO | \\d+.*id_code | timeout=60 |
| ${logs} | CloudWatch Wait For Logs | /aws/group_name | " " | \\w+.*some_code | not_found_fail=${True} |</doc>
| ${logs} | CloudWatch Wait For Logs | /aws/group_name | INFO | code.*id_code | timeout=60 |
| ${logs} | CloudWatch Wait For Logs | /aws/group_name | " " | code.*some_code | not_found_fail=${True} |</doc>
<shortdoc>Wait until find the wanted log in cloudwatch.</shortdoc>
</kw>
<kw name="Create Bucket" deprecated="true" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\s3.py" lineno="16">
Expand Down Expand Up @@ -389,7 +389,7 @@ existing item.
| ``table_name`` | &lt;dict&gt; JSON dictionary representing the dynamo item. |

*Examples:*
| Update Item | library-books | {"key": "value"} |</doc>
| Dynamo Put Item | library-books | {"key": "value"} |</doc>
<shortdoc>Creates a new item, or replaces an old item with a new item. If an item that has the same partition key (primary key) as the new item already exists in the specified table, the new item completely replaces the existing item.</shortdoc>
</kw>
<kw name="Dynamo Query Table" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\dynamo.py" lineno="28">
Expand Down Expand Up @@ -623,34 +623,6 @@ could be used to list only the files inside a folder for example.
| List Objects | bucket_name | folder_name/start_of_the_filename |</doc>
<shortdoc>*DEPRECATED - this keyword will be removed in version 2.0.0* use `S3 List Objects` instead</shortdoc>
</kw>
<kw name="Local File Should Exist" deprecated="true" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\resource.py" lineno="10">
<arguments repr="path">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path">
<name>path</name>
</arg>
</arguments>
<doc>*DEPRECATED - this keyword will be removed in version 2.0.0*

Verifies Local File at the given path does exist
Requires: @param: ```path``` which is the bucket location/path name.
Example:
| Local File Should Exist | bucket | path |</doc>
<shortdoc>*DEPRECATED - this keyword will be removed in version 2.0.0*</shortdoc>
</kw>
<kw name="Local File Should Not Exist" deprecated="true" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\resource.py" lineno="28">
<arguments repr="path">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path">
<name>path</name>
</arg>
</arguments>
<doc>*DEPRECATED - this keyword will be removed in version 2.0.0*

Verifies Local File at the given path does not exist
Requires: @param: ```path``` which is the bucket location/path name.
Example:
| Local File Should Not Exist | bucket | path |</doc>
<shortdoc>*DEPRECATED - this keyword will be removed in version 2.0.0*</shortdoc>
</kw>
<kw name="S3 Copy Between Buckets" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\s3.py" lineno="417">
<arguments repr="source_bucket, source_key, destination_bucket, destination_key">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="source_bucket">
Expand Down Expand Up @@ -691,7 +663,7 @@ Requires: @param: ```path``` which is the bucket location/path name.
| ``bucket`` | &lt;str&gt; The bucket name. |

*Examples:*
| S3 Create bucket | bucket_name |</doc>
| S3 Create Bucket | bucket_name |</doc>
<shortdoc>Creates S3 Bucket with the given bucket name</shortdoc>
</kw>
<kw name="S3 Delete File" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\s3.py" lineno="272">
Expand Down Expand Up @@ -754,8 +726,8 @@ Requires: @param: ```path``` which is the bucket location/path name.
| ``key`` | &lt;str&gt; Complete s3 filepath. |

*Examples:*
| Get S3 File Content | bucket_name | s3_file.json |
| Get S3 File Content | bucket_name | folder_name/s3_file.txt |</doc>
| S3 Get File Content | bucket_name | s3_file.json |
| S3 Get File Content | bucket_name | folder_name/s3_file.txt |</doc>
<shortdoc>Get the file content in S3 bucket.</shortdoc>
</kw>
<kw name="S3 Get File Metadata" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\s3.py" lineno="397">
Expand All @@ -774,8 +746,8 @@ Requires: @param: ```path``` which is the bucket location/path name.
| ``key`` | &lt;str&gt; Complete s3 filepath. |

*Examples:*
| Get S3 File Metadata | bucket_name | s3_file.json |
| Get S3 File Metadata | bucket_name | folder_name/s3_file.txt |</doc>
| S3 Get File Metadata | bucket_name | s3_file.json |
| S3 Get File Metadata | bucket_name | folder_name/s3_file.txt |</doc>
<shortdoc>Get the file metadata in S3 bucket.</shortdoc>
</kw>
<kw name="S3 Key Should Exist" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\s3.py" lineno="337">
Expand Down Expand Up @@ -884,6 +856,99 @@ appropriate URL to use when communicating with a service. You can specify a comp
| S3 Upload File | bucket_name | folder/s3_file.txt | ${CURDIR}/file.txt |</doc>
<shortdoc>Upload a file to the bucket</shortdoc>
</kw>
<kw name="Sqs Delete All Messages" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\sqs.py" lineno="86">
<arguments repr="queue_name: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="queue_name: str">
<name>queue_name</name>
<type name="str" typedoc="string"/>
</arg>
</arguments>
<doc>Delete All Messages In SQS

| =Arguments= | =Description= |
| ``queue_name`` | &lt;str&gt; The queue name. |

*Example:*
| Sqs Delete All Messages | queue_name |</doc>
<shortdoc>Delete All Messages In SQS</shortdoc>
</kw>
<kw name="Sqs Receive Messages" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\sqs.py" lineno="58">
<arguments repr="queue_name: str, max_number: int = 10, wait_time: int = 10">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="queue_name: str">
<name>queue_name</name>
<type name="str" typedoc="string"/>
</arg>
<arg kind="POSITIONAL_OR_NAMED" required="false" repr="max_number: int = 10">
<name>max_number</name>
<type name="int" typedoc="integer"/>
<default>10</default>
</arg>
<arg kind="POSITIONAL_OR_NAMED" required="false" repr="wait_time: int = 10">
<name>wait_time</name>
<type name="int" typedoc="integer"/>
<default>10</default>
</arg>
</arguments>
<returntype name="list" typedoc="list"/>
<doc>Receive Messages From Queue

| =Arguments= | =Description= |
| ``queue_name`` | &lt;str&gt; The queue name. |
| ``max_number`` | &lt;Optional int&gt; Max number of messages to receive. Default as 10 |
| ``wait_time`` | &lt;Optional int&gt; Wait until to get the messages. Default as 10 seconds |

*Example:*
| ${messages_list} | Sqs Receive Messages | queue_name |
| ${messages_list} | Sqs Receive Messages | queue_name | max_number=20 | wait_time=30 |</doc>
<shortdoc>Receive Messages From Queue</shortdoc>
</kw>
<kw name="Sqs Send Message" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\sqs.py" lineno="28">
<arguments repr="queue_name: str, message_body: str, message_attributes=None">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="queue_name: str">
<name>queue_name</name>
<type name="str" typedoc="string"/>
</arg>
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="message_body: str">
<name>message_body</name>
<type name="str" typedoc="string"/>
</arg>
<arg kind="POSITIONAL_OR_NAMED" required="false" repr="message_attributes=None">
<name>message_attributes</name>
<default>None</default>
</arg>
</arguments>
<doc>Send a Message to Queue

| =Arguments= | =Description= |
| ``queue_name`` | &lt;str&gt; The queue name. |
| ``message_body`` | &lt;str&gt; message to send. |
| ``message_attributes`` | &lt;Optional&gt; Metadata to send. |

*Example 1:*
| Sqs Send Message | queue_name | Hello World! |

*Example 2:*
| ${message_attributes} | Create Dictionary | Example | ${order_type} |
| Sqs Send Message | sqs_name | Hello World! | ${message_attributes} |</doc>
<shortdoc>Send a Message to Queue</shortdoc>
</kw>
<kw name="Sqs Set Endpoint Url" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\sqs.py" lineno="14">
<arguments repr="url">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url">
<name>url</name>
</arg>
</arguments>
<doc>The complete URL to use for the constructed S3 client. Normally, botocore will automatically construct the
appropriate URL to use when communicating with a service. You can specify a complete URL
(including the “http/https” scheme) to override this behavior.

| =Arguments= | =Description= |
| ``url`` | &lt;str&gt; The complete endpoint URL. |

*Examples:*
| Sqs Set Endpoint Url | http://localhost:4566/ |</doc>
<shortdoc>The complete URL to use for the constructed S3 client. Normally, botocore will automatically construct the appropriate URL to use when communicating with a service. You can specify a complete URL (including the “http/https” scheme) to override this behavior.</shortdoc>
</kw>
<kw name="Upload File" deprecated="true" source="C:\Merkle\repositories\robotframework-aws\src\AWSLibrary\keywords\s3.py" lineno="127">
<arguments repr="bucket, key, path, endpoint_url=None">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="bucket">
Expand Down Expand Up @@ -916,5 +981,58 @@ Upload a file to the bucket
</kw>
</keywords>
<typedocs>
<type name="integer" type="Standard">
<doc>Conversion is done using Python's [https://docs.python.org/library/functions.html#int|int]
built-in function. Floating point
numbers are accepted only if they can be represented as integers exactly.
For example, ``1.0`` is accepted and ``1.1`` is not.

Starting from RF 4.1, it is possible to use hexadecimal, octal and binary
numbers by prefixing values with ``0x``, ``0o`` and ``0b``, respectively.

Starting from RF 4.1, spaces and underscores can be used as visual separators
for digit grouping purposes.

Examples: ``42``, ``-1``, ``0b1010``, ``10 000 000``, ``0xBAD_C0FFEE``
</doc>
<accepts>
<type>string</type>
<type>float</type>
</accepts>
<usages>
<usage>Sqs Receive Messages</usage>
</usages>
</type>
<type name="list" type="Standard">
<doc>Strings must be Python [https://docs.python.org/library/stdtypes.html#list|list]
literals. They are converted to actual lists using the
[https://docs.python.org/library/ast.html#ast.literal_eval|ast.literal_eval]
function. They can contain any values ``ast.literal_eval`` supports, including
lists and other containers.

If the type has nested types like ``list[int]``, items are converted
to those types automatically. This in new in Robot Framework 6.0.

Examples: ``['one', 'two']``, ``[('one', 1), ('two', 2)]``
</doc>
<accepts>
<type>string</type>
<type>Sequence</type>
</accepts>
<usages>
<usage>Sqs Receive Messages</usage>
</usages>
</type>
<type name="string" type="Standard">
<doc>All arguments are converted to Unicode strings.</doc>
<accepts>
<type>Any</type>
</accepts>
<usages>
<usage>Sqs Delete All Messages</usage>
<usage>Sqs Receive Messages</usage>
<usage>Sqs Send Message</usage>
</usages>
</type>
</typedocs>
</keywordspec>
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

def readme():
with open('README.md') as f:
README = f.read()
return README
read_me = f.read()
return read_me


setup(
name='robotframework-aws',
version='0.2.0',
version='1.0.0',
author="Dillan Teagle",
author_email="[email protected]",
description="A python package to test AWS services in Robot Framework",
Expand Down
2 changes: 0 additions & 2 deletions src/AWSLibrary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from AWSLibrary.keywords import (
SessionKeywords,
S3Keywords,
ResourceKeywords,
DynamoKeywords,
CloudWatchKeywords
)
Expand Down Expand Up @@ -45,7 +44,6 @@ def __init__(self):
libraries = [
SessionKeywords(self),
S3Keywords(self),
ResourceKeywords(self),
DynamoKeywords(self),
CloudWatchKeywords(self),
SQSKeywords(self)
Expand Down
2 changes: 0 additions & 2 deletions src/AWSLibrary/keywords/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from AWSLibrary.keywords.session import SessionKeywords
from AWSLibrary.keywords.s3 import S3Keywords
from AWSLibrary.keywords.resource import ResourceKeywords
from AWSLibrary.keywords.dynamo import DynamoKeywords
from AWSLibrary.keywords.cloudWatch import CloudWatchKeywords
from AWSLibrary.keywords.sqs import SQSKeywords
Expand All @@ -9,7 +8,6 @@
__all__ = [
SessionKeywords,
S3Keywords,
ResourceKeywords,
DynamoKeywords,
CloudWatchKeywords,
SQSKeywords
Expand Down
2 changes: 1 addition & 1 deletion src/AWSLibrary/keywords/dynamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def dynamo_update_item(self, table_name, json_dict):
| ``table_name`` | <dict> JSON dictionary representing the dynamo item. |

*Examples:*
| Update Item | library-books | {"key": "value"} |
| Dynamo Put Item | library-books | {"key": "value"} |
"""
resource = self.library.session.resource('dynamodb', endpoint_url=self.endpoint_url)
response = resource.Table(table_name).put_item(Item=json_dict)
Expand Down
43 changes: 0 additions & 43 deletions src/AWSLibrary/keywords/resource.py

This file was deleted.

Loading
Loading