Top 3.0% dependent packages on proxy.golang.org
Top 0.9% dependent repos on proxy.golang.org
Top 0.1% forks on proxy.golang.org
proxy.golang.org : github.com/awsdocs/aws-doc-sdk-examples/gov2/testtools
Package testtools provides a set of tools to help test code that calls AWS services. **AWS Middleware Stubber** The AWS Middleware Stubber is a unit testing tool that hooks into the AWS SDK for Go middleware (https://aws.github.io/aws-sdk-go-v2/docs/middleware/) to short-circuit calls to AWS services, verify inputs, and return predefined outputs. This improves unit testing because you don't have to define mocks or change the way your code calls AWS. Tests run without calling AWS, which means tests run faster and don't incur charges or risk impacting your resources. To use AwsmStubber, first create an instance of AwsmStubber. The stubber is configured to handle all calls to AWS before the Serialize middleware step. Use the stubber config to create a service client. Define and add all service actions that are called by your test. During your test run, the stubber verifies that each call is made in the order that stubs are added to the stubber. The stubber also checks actual input against expected input. If the call is verified, either the specified output is returned or, if an error is requested, the error is returned. Run your test and verify the results. Use testtools helper functions to verify errors and run exit code. By using sub tests, you can use the same test code to test both error and non-error paths. The testtools.ExitTest helper verifies that all expected stubs were called during the test, so if your test exits early and leaves uncalled stubs, the test fails. **Framework** The framework section of the package provides a set of helper functions that you can use in your tests to perform common tasks, such as verifying that errors returned from the code under test match up with the expected errors, and running exit checks to verify all stubs were called. **Scenarios** The scenarios section of the package provides a set of helper functions that you can use to run scenario tests. Scenarios typically string together several actions in a narrative format. The scenario test functions let you define the expected actions of your scenario as a list of stubs. Then, your test function is called first with no errors, and subsequently with each stub set to return an error. **Mocks** The mocks section of the package provides mocks of components that are used in the code examples, such as a mock of the IQuestioner interface that lets you specify a list of expected answers. The mock questioner returns these answers in sequence during a test to mock user input.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/awsdocs/aws-doc-sdk-examples/gov2/testtools
Keywords:
aws
, cpp
, documentation
, dotnet
, examples
, go
, java
, javascript
, php
, programming
, python
, ruby
License: Apache-2.0
Latest release: over 1 year ago
First release: about 3 years ago
Namespace: github.com/awsdocs/aws-doc-sdk-examples/gov2
Dependent packages: 9
Dependent repositories: 39
Stars: 7,470 on GitHub
Forks: 5,013 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 days ago
v0.0.0-20230614172750-901f304a9b5e
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230614145755-4c0aa72ca6d2
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230614133105-666a8781c9b3
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230614124413-67e18788ad39
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230614123223-56c101097707
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230614112159-7e2d6f0d44da
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230613203345-a72cce8e5cf7
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230613184918-ff5cec1fe781
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230613183912-4ba90cccc370
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230613180353-68f996ae7d56
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230612231516-ac73d65bd195
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230608223936-d6da643b2a75
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230608210941-bf53c23f4b7c
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230608202958-4694e3d71beb
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230607202440-f35a0a23ae1e
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230607200557-68d4ae64ae85
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230607185838-86cafb003607
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230607145048-0168c3dc5b0c
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230607143115-f36794964f1b
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230606234941-bc5c37773362
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230606233040-f27117b1b8e0
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230606221736-acf286a4af8c
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230606220127-a22ba559959a
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230606161129-d1f465816e3c
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230605211019-48ba27ae5203
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230605202812-d1132131ac78
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230605165347-5f4dbeb26a14
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230601213355-abdd1d96cfc6
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230531193224-41118854837b
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230526201137-2393723ef6b0
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230526150421-fae8869ef40c
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230525162119-36f51bc81af7
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230525124051-21a4cf888dcc
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230524191140-ef93e96cef3e
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230524162947-8ce3d5218d33
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230523153805-9ed2ff1838ce
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230523131216-6b3b6c4d7ee8
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230522170601-102ebfa6dc71
Published: almost 2 years agoRegistry - Documentation - Download
v0.0.0-20230519192356-926ee5c61d9f
Published: almost 2 years agoRegistry - Documentation - Download