{"id":24441665,"url":"https://github.com/tsnoblesoftware/awssert","last_synced_at":"2025-04-12T20:13:35.134Z","repository":{"id":52703206,"uuid":"354824835","full_name":"TSNobleSoftware/awssert","owner":"TSNobleSoftware","description":"Declarative assertions for AWS","archived":false,"fork":false,"pushed_at":"2021-04-20T18:05:53.000Z","size":120,"stargazers_count":19,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T20:13:28.610Z","etag":null,"topics":["aws","boto3","pytest","pytest-plugin","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TSNobleSoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-05T12:19:46.000Z","updated_at":"2022-01-04T14:34:53.000Z","dependencies_parsed_at":"2022-08-22T08:51:12.752Z","dependency_job_id":null,"html_url":"https://github.com/TSNobleSoftware/awssert","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSNobleSoftware%2Fawssert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSNobleSoftware%2Fawssert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSNobleSoftware%2Fawssert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSNobleSoftware%2Fawssert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TSNobleSoftware","download_url":"https://codeload.github.com/TSNobleSoftware/awssert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625517,"owners_count":21135514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","boto3","pytest","pytest-plugin","python3"],"created_at":"2025-01-20T21:18:49.565Z","updated_at":"2025-04-12T20:13:35.114Z","avatar_url":"https://github.com/TSNobleSoftware.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWSsert\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/TSNobleSoftware/awssert/Test)\n![PyPI](https://img.shields.io/pypi/v/awssert)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/awssert)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nAWSsert is a Python library providing declarative assertions about AWS resources to your tests.\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install AWSsert.\n\n```bash\npip install awssert\n```\n\n## Usage\n\nInstalling the package will make AWSserts extra assertions available to all of your tests. Assertions are attached directly to [boto3](https://github.com/boto/boto3) resource objects, allowing you to write clean and declarative tests:\n\n```python\nimport boto3\n\ndef test_bucket_contains_object():\n   bucket = boto3.resource(\"s3\").Bucket(\"foo\")\n   assert bucket.should_not.contain(\"bar\")\n   bucket.put_object(Key=\"bar\", Body=b\"123\")\n   assert bucket.should.contain(\"bar\")\n```\n\nAWSsert also works in tandem with [moto](https://pypi.org/project/moto/), enabling the same level of clarity to be applied on mock infrastructure:\n\n```python\nimport boto3\nfrom moto import mock_s3\n\n@mock_s3\ndef test_mock_bucket_contains_object():\n   bucket = boto3.resource(\"s3\").Bucket(\"foo\")\n   assert bucket.should_not.contain(\"bar\")\n   bucket.put_object(Key=\"bar\", Body=b\"123\")\n   assert bucket.should.contain(\"bar\")\n```\n\n## Progress\n\n| AWS Service | Resource Object             | AWSsert Supported |\n|-------------|-----------------------------|-------------------|\n|CloudFormation|Event                       |:x:                |\n|             |Stack                        |:x:                |\n|             |StackResource                |:x:                |\n|             |StackResourceSummary         |:x:                |\n|CloudWatch   |Alarm                        |:x:                |\n|             |Metric                       |:x:                |\n|DynamoDB     |Table                        |:white_check_mark: |\n|EC2          |ClassicAddress               |:x:                |\n|             |DhcpOptions                  |:x:                |\n|             |Image                        |:x:                |\n|             |Instance                     |:x:                |\n|             |InternetGateway              |:x:                |\n|             |KeyPair                      |:x:                |\n|             |KeyPairInfo                  |:x:                |\n|             |NetworkAcl                   |:x:                |\n|             |NetworkInterface             |:x:                |\n|             |NetworkInterfaceAssociation  |:x:                |\n|             |PlacementGroup               |:x:                |\n|             |Route                        |:x:                |\n|             |RouteTable                   |:x:                |\n|             |RouteTableAssociation        |:x:                |\n|             |SecurityGroup                |:x:                |\n|             |Snapshot                     |:x:                |\n|             |Subnet                       |:x:                |\n|             |Tag                          |:x:                |\n|             |Volume                       |:x:                |\n|             |Vpc                          |:x:                |\n|             |VpcPeeringConnection         |:x:                |\n|             |VpcAddress                   |:x:                |\n|Glacier      |Account                      |:x:                |\n|             |Archive                      |:x:                |\n|             |Job                          |:x:                |\n|             |MultipartUpload              |:x:                |\n|             |Notification                 |:x:                |\n|             |Vault                        |:x:                |\n|IAM          |AccessKey                    |:x:                |\n|             |AccessKeyPair                |:x:                |\n|             |AccountPasswordPolicy        |:x:                |\n|             |AccountSummary               |:x:                |\n|             |AssumeRolePolicy             |:x:                |\n|             |CurrentUser                  |:x:                |\n|             |Group                        |:white_check_mark: |\n|             |GroupPolicy                  |:x:                |\n|             |InstanceProfile              |:x:                |\n|             |LoginProfile                 |:x:                |\n|             |MfaDevice                    |:x:                |\n|             |Policy                       |:white_check_mark: |\n|             |PolicyVersion                |:x:                |\n|             |Role                         |:white_check_mark: |\n|             |RolePolicy                   |:x:                |\n|             |SamlProvider                 |:x:                |\n|             |ServerCertificate            |:x:                |\n|             |SigningCertificate           |:x:                |\n|             |User                         |:white_check_mark: |\n|             |UserPolicy                   |:x:                |\n|             |VirtualMfaDevice             |:x:                |\n|OpsWorks     |Layer                        |:x:                |\n|             |Stack                        |:x:                |\n|             |StackSummary                 |:x:                |\n|S3           |Bucket                       |:white_check_mark: |\n|             |BucketAcl                    |:x:                |\n|             |BucketCors                   |:x:                |\n|             |BucketLifecycle              |:x:                |\n|             |BucketLifecycleConfiguration |:x:                |\n|             |BucketLogging                |:x:                |\n|             |BucketNotification           |:x:                |\n|             |BucketPolicy                 |:x:                |\n|             |BucketRequestPayment         |:x:                |\n|             |BucketTagging                |:x:                |\n|             |BucketVersioning             |:x:                |\n|             |BucketWebsite                |:x:                |\n|             |MultipartUpload              |:x:                |\n|             |MultipartUploadPart          |:x:                |\n|             |Object                       |:x:                |\n|             |ObjectAcl                    |:x:                |\n|             |ObjectSummary                |:x:                |\n|             |ObjectVersion                |:x:                |\n|SNS          |PlatformApplication          |:x:                |\n|             |PlatformEndpoint             |:x:                |\n|             |Subscription                 |:x:                |\n|             |Topic                        |:white_check_mark: |\n|SQS          |Message                      |:x:                |\n|             |Queue                        |:x:                |\n\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nA full [contribution guide](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) are supplied with the repository. In essence, update the unit tests and changelog, and treat fellow users with respect!\n\n## License\n[Apache Software License 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsnoblesoftware%2Fawssert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsnoblesoftware%2Fawssert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsnoblesoftware%2Fawssert/lists"}