Moto
VCR.py
Our great sponsors
Moto | VCR.py | |
---|---|---|
32 | 6 | |
7,339 | 2,592 | |
1.4% | - | |
9.9 | 9.0 | |
7 days ago | 7 days ago | |
Python | Python | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Moto
-
OpenTF Announces Fork of Terraform
> OpenMoto
I dunno if you're trying to play on "hashimoto" but https://github.com/getmoto/moto#readme would be a prime name collision for any such "OpenMoto" name
But yes, please, to adopting Vault. I don't have a horse in the race about Consul but my suspicion is such an effort would only be worthwhile if trying to adopt Nomad, too, which I gravely doubt
-
What is the development enviroment for AWS?
If using Python use Moto to mock AWS Services
-
Guide to AWS Serverless & Lambda Testing Best Practices — Part 1
The Pythonic motto library mocks AWS services, removing the need to deploy your application or pay for API calls against AWS services. Other programming languages have their motto implementation.
- Final FLiP Stack Weekly of 2022
-
Do unit tests make sense here?
To add on to the integration tests point, for mocking out your AWS resources you should check out moto if you don't want run your test against real AWS resources as they may cost you and is usually slower.
-
Do some developers actually, REALLY, have no local environment and run everything in AWS? Is the individual cloud dev environment a real alternative to having things running locally?
You should be able to unit test your application on any device. (I use moto to help there.) And then when you want to ensure that you've given your lambda the right security groups or whatever, you deploy to a real but non-production lambda, and that deployment can be from anywhere.
-
Getting started with testing DynamoDB code in Python
The Python package moto bundles mocks for many AWS services, including DynamoDB. The DynamoDB mock behaves mainly like the service - we can create tables, add data, query data, remove data, and much more. Not all features are supported, though - the documentation lists the available API calls. We can use this in combination with pytest to create a simple test setup.
-
Mocking AWS Dynamo Db calls during testing
moto is an amazing library to mock any AWS Dynamo DB based calls. You can check out the development on their GitHub page.
- How to handle cloud resources in your application while running localhost
- Localstack – Local AWS Emulator
VCR.py
-
Please recommend a good API Mocking tool
I made a library for this: https://github.com/kevin1024/vcrpy
-
3 Ways to Unit Test REST APIs in Python
Now it’s finally the time to discuss our last option. I have only found about it quite recently, frankly. I’ve been using mocks for a long time and always had some problem with them. VCR.py is a library that simplifies a lot the tests that make HTTP requests.
- My Python testing style guide – Stargirl (Thea) Flowers
-
Two Methods for Testing HTTPS API Calls with Python and pytest and also Communicating with the In-laws
Unfortunately, VCR.py only supports a certain number of HTTP client libraries. Thankfully, some very popular implementations are included: the Python built-in urllib and http.client, as well as requests, urllib3, and aiohttp. And, while it may not be listed in the docs at the time of this writing, the changelog notes that HTTPX is also supported. Sadly, pycurl is not supported.
-
Magic numbers for Verify?
I don't normally work in Python, so I'm not used to writing mocks. You should be able to mock the client, but if that is too much you might look into something like VCR.py which records underlying HTTP interactions and then plays them back in further tests. (Make sure to redact any API keys from the cassettes though.)
-
playback-proxy - record communication between client and server and play it back later during testing
https://betamax.readthedocs.io/en/latest/ https://github.com/kevin1024/vcrpy
What are some alternatives?
LocalStack - 💻 A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline
responses - A utility for mocking out the Python Requests library.
mock - The Python mock library
betamax - A VCR imitation designed only for python-requests.
httpretty - Intercept HTTP requests at the Python socket level. Fakes the whole socket module
aws-sdk-go - AWS SDK for the Go programming language.
aws-cdk-local - Thin wrapper script for using the AWS CDK CLI with LocalStack
freezegun - Let your Python tests travel through time
Mocket - a socket mock framework - for all kinds of socket animals, web-clients included