aws2openapi icon indicating copy to clipboard operation
aws2openapi copied to clipboard

Add tests using moto and pyopenapi

Open sverch opened this issue 5 years ago • 6 comments

The AWS v4 signing process makes it difficult to test that these specs actually work against the real AWS API, but moto has an option to disable authentication, and has a "standalone server" mode where it looks like the AWS API (which is why it's the basis of localstack).

I think it would be possible to get some local tests running (and even some CI) by using this, perhaps using something like pyopenapi.

sverch avatar Mar 07 '20 03:03 sverch

https://github.com/Teebytes/TnT-Fuzzer also might combine well with moto.

sverch avatar Mar 07 '20 03:03 sverch

Although that doesn't appear to support 3.0 yet, and I don't know if it supports XML.

sverch avatar Mar 07 '20 03:03 sverch

Thanks, good ideas!

MikeRalphson avatar Mar 07 '20 07:03 MikeRalphson

There is also https://www.npmjs.com/package/aws-sdk-mock in node.js land.

MikeRalphson avatar Mar 07 '20 12:03 MikeRalphson

Taking another look at pyopenapi, it doesn't appear to be ready to use. See this issue about updating the README from 2018.

Unfortunately pyswagger only supports 2.0 specs.

It might still be useful to use moto though, maybe just with openapi-generator as a test setup step.

sverch avatar Mar 07 '20 21:03 sverch

I'm not sure if the mock for node.js has this, but the main reason I brought up moto is the standalone server mode.

sverch avatar Mar 07 '20 21:03 sverch