简体   繁体   中英

How to unit test aws athena sql queries in python lambda?

I have a python lambda that will call an SQL query to Athena for pulling certain data for my lambda calculation. How do I unit test Athena queries in the lambda? As lambda uses some other services I used MOTO to mock services.

I think you can write an unit test code locally as long as the business logic is separated from lambda specific code like even and context. Here is an example.

Unfortunately, moto has not supported Athena yet. You can make an issue to request a new feature with your use cases or you can make new pull request. Anyway the community would help you. GitHub - moto

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM