The recommended path for upgrading a Python 2 AppEngine app to the new runtime is to switch datastore code to Google Cloud NDB. However, I can't find anything about unit testing code that uses Cloud NDB (which was previously possible using the Python 2 testbed library).
How can Cloud NDB code be unit tested? (apart from standard abstracting the Cloud NDB dependency yourself)
App Engine NDB enables Python 2 apps to store and query data in Datastore databases. Cloud NDB enables Python 2 and Python 3 apps to store and query data in the same databases, however the product that manages those databases has changed from Datastore to Firestore in Datastore mode (Datastore).
They enable you to catch bugs early in the development process. Automated unit tests help a great deal with regression testing. They detect code smells in your codebase. For example, if you're having a hard time writing unit tests for a piece of code, it might be a sign that your function is too complex.
Apparently, there is no way to unit test Cloud NDB code anymore. The only testing solution available is the Cloud Datastore Emulator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With