Declarative assertions for AWS

Overview

AWSsert

GitHub Workflow Status PyPI PyPI - Python Version Code style: black

AWSsert is a Python library providing declarative assertions about AWS resources to your tests.

Installation

Use the package manager pip to install AWSsert.

pip install awssert

Usage

Installing the package will make AWSserts extra assertions available to all of your tests. Assertions are attached directly to boto3 resource objects, allowing you to write clean and declarative tests:

import boto3

def test_bucket_contains_object():
   bucket = boto3.resource("s3").Bucket("foo")
   assert bucket.should_not.contain("bar")
   bucket.put_object(Key="bar", Body=b"123")
   assert bucket.should.contain("bar")

AWSsert also works in tandem with moto, enabling the same level of clarity to be applied on mock infrastructure:

import boto3
from moto import mock_s3

@mock_s3
def test_mock_bucket_contains_object():
   bucket = boto3.resource("s3").Bucket("foo")
   assert bucket.should_not.contain("bar")
   bucket.put_object(Key="bar", Body=b"123")
   assert bucket.should.contain("bar")

Progress

AWS Service Resource Object AWSsert Supported
CloudFormation Event
Stack
StackResource
StackResourceSummary
CloudWatch Alarm
Metric
DynamoDB Table
EC2 ClassicAddress
DhcpOptions
Image
Instance
InternetGateway
KeyPair
KeyPairInfo
NetworkAcl
NetworkInterface
NetworkInterfaceAssociation
PlacementGroup
Route
RouteTable
RouteTableAssociation
SecurityGroup
Snapshot
Subnet
Tag
Volume
Vpc
VpcPeeringConnection
VpcAddress
Glacier Account
Archive
Job
MultipartUpload
Notification
Vault
IAM AccessKey
AccessKeyPair
AccountPasswordPolicy
AccountSummary
AssumeRolePolicy
CurrentUser
Group
GroupPolicy
InstanceProfile
LoginProfile
MfaDevice
Policy
PolicyVersion
Role
RolePolicy
SamlProvider
ServerCertificate
SigningCertificate
User
UserPolicy
VirtualMfaDevice
OpsWorks Layer
Stack
StackSummary
S3 Bucket
BucketAcl
BucketCors
BucketLifecycle
BucketLifecycleConfiguration
BucketLogging
BucketNotification
BucketPolicy
BucketRequestPayment
BucketTagging
BucketVersioning
BucketWebsite
MultipartUpload
MultipartUploadPart
Object
ObjectAcl
ObjectSummary
ObjectVersion
SNS PlatformApplication
PlatformEndpoint
Subscription
Topic
SQS Message
Queue

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

A full contribution guide and code of conduct are supplied with the repository. In essence, update the unit tests and changelog, and treat fellow users with respect!

License

Apache Software License 2.0

Owner
A collection of open source repositories created by @TSNoble
A simple and stupid Miinto API wrapper

miinto-api-wrapper Miinto API Wrapper is a simple python wrapper for Miinto API. Miinto is a fashion luxury marketplace. For more information see the

Giuseppe Checchia 3 Jan 09, 2022
cipher bot telegram

cipher-bot-telegram cipher bot telegram Telegram bot that encode/decode your messages To work correctly, you must install the latest version of python

anonim 1 Oct 10, 2021
Easy to use API Wrapper for somerandomapi.ml.

Overview somerandomapi is an API Wrapper for some-random-api.ml Examples Asynchronous from somerandomapi import Animal import asyncio async def main

Myxi 1 Dec 31, 2021
Bender: A Markov Babbler Slack Bot

See the Digital Ocean tutorial for instructions on how to get the basic bot structure in place. Once you have that, set the gunicorn command to run as

Andrew Howard 1 Dec 04, 2021
Leveraged grid-trading bot using CCXT/CCXT Pro library in FTX exchange.

Leveraged-grid-trading-bot The code is designed to perform infinity grid trading strategy in FTX exchange. The basic trader named Gridtrader.py contro

Hao-Liang Wen 25 Oct 07, 2021
A Telegram Bot To Stream Videos in Telegram Voice Chat.

Video Stream X Bot Telegram bot project for streaming video on telegram video chat, powered by tgcalls and pyrogram Deploy to Heroku 👨‍🔧 The easy wa

Mⷨoͦns͛ᴛⷮeͤrͬ Zeͤrͬoͦ 13 Dec 05, 2022
A simple library for interacting with Amazon S3.

BucketStore is a very simple Amazon S3 client, written in Python. It aims to be much more straight-forward to use than boto3, and specializes only in

Jacobi Petrucciani 219 Oct 03, 2022
Unofficial Coinbase Python Library

Unofficial Coinbase Python Library Python Library for the Coinbase API for use with three legged oAuth2 and classic API key usage Version 0.3.0 Requir

George Sibble 104 Dec 01, 2022
Discord-shell - Reverse shell accessible via discord.py bot

Discord-shell reverse shell on discord bot. (STILL IN DEVELOPMENT) Installation

Skultz 6 Oct 21, 2022
A module grouping multiple translation APIs

translatepy (originally: translate) An aggregation of multiple translation API Translate, transliterate, get the language of texts in no time with the

349 Jan 06, 2023
A PowerFull Telegram Mirror Bot.......

- [ DEAD REPO AND NO MORE UPDATE ] Slam Mirror Bot Slam Mirror Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Interne

αвιנтн 2 Nov 09, 2021
Awslogs - AWS CloudWatch logs for Humans™

awslogs awslogs is a simple command line tool for querying groups, streams and events from Amazon CloudWatch logs. One of the most powerful features i

Jorge Bastida 4.5k Dec 30, 2022
Full-featured Python interface for the Slack API

This repository is archived and will not receive any updates It's time to say goodbye. I'm archiving Slacker. It's been getting harder to find time to

Oktay Sancak 1.6k Dec 13, 2022
A stock information collector and parser for Taiwan and US market. Automatically send LINE message if the pre-defined rules are triggered.

agastock 開發動機 就在海運飆漲的2021年7月,差點跪在地上喜迎財富自由的當下,EPS超高好消息不斷的長榮竟然套在202元一去不回,有圖有真相(哭) 忽然體會到追高殺低不是辦法,魯蛇我得靠邏輯分析也能出頭天,經過三個月無數個不出門的周末,產出簡單的爬蟲和分析工具。 上過金融研訓院的量化交易

Gavin Lee 12 Nov 16, 2022
Stack Overflow Error Parser

A python tool that executes python files and opens respective Stack Overflow threads in browser for errors encountered.

Raghavendra Khare 3 Jul 24, 2022
Unofficial calendar integration with Gradescope

Gradescope-Calendar This script scrapes your Gradescope account for courses and assignment details. Assignment details currently can be transferred to

6 May 06, 2022
Clisd.py - UI framework with client side rendering for python

clisd.py Clisd is UI framework with client side rendering for python. It uses WA

2 Mar 25, 2022
A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py)

Articuno (discord-interactions) A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py) Get started If you wa

Blue 8 Dec 26, 2022
This is a repository for the Duke University Cloud Computing course project on Serveless Data Engineering Pipeline. For this project, I recreated the below pipeline.

AWS Data Engineering Pipeline This is a repository for the Duke University Cloud Computing course project on Serverless Data Engineering Pipeline. For

15 Jul 28, 2021
python script to buy token from pancakeswap

pancakeswapBot python script to buy token from pancakeswap Change your privatekey!!! on line 58 (signed_txn = web3.eth.account.sign_transaction(pancak

206 Dec 31, 2022