GeezerVison is showing github.com — How can we cover unit testing for datastore? · Issue #2 · googleapis/google-cloud-python
How can we cover unit testing for datastore? #2DescriptionRight now, the only way to develop this is by hitting the live Cloud Datastore API. Is there a way we can use these API calls in unit tests without mocking?
Can we have a "local datastore" server that understands the API and makes it easy for local development? Activityproppy commented on Jan 29, 2014 jgeewax commented on Jan 30, 2014 ContributorAuthor More actions That looks good for local development. It runs on Java right ?
I wonder how difficult it would be to patch in the stubs from AppEngine's dev_appserver.py so that i can use something akin to ext.testbed to unittest locally (ie, without hitting the wire, stay all in Python). proppy commented on Jan 30, 2014
That looks good for local development. It runs on Java right ?
Yes, it is embedding the App Engine Java development server and running the same servlet that is running in production.
I wonder how difficult it would be to patch in the stubs from AppEngine's dev_appserver.py so that i can use something akin to ext.testbed to unittest locally (ie, without hitting the wire, stay all in Python).
You would have to handle the datastore_v1.proto to datastore_v4 convertion somehow.
Keep in mind that datastore_v4 private interface is not really documented and also subject to change: datastore_v1 is the public versionned interface. jgeewax commented on Jan 30, 2014 ContributorAuthor More actions Yikes. Well I realllly don't want to force people to spin up a local server in order to run unit tests...
We'll have to come up with a way to stub this out. tseaver commented on Sep 23, 2014 #130 adds 100% unit test coverage for modules in gcloud, gcloud.datastore. I would call its strategy "stubbing" (testcases explicitly stub out the http or connection objects) rather than "mocking" (using a general-purpose utilitiy like 'mock'). tseaver commented on Oct 17, 2014 #106 exists to cover the deficiencies of testing with stubbed / mocked backends. added 6 commits that reference this issue on Nov 24, 2025This issue will close once commit 7ae7c34 is merged into the 'main' branch.7ae7c34 This issue will close once commit 5d3931f is merged into the 'main' branch.5d3931f This issue will close once commit 7cdc1f2 is merged into the 'main' branch.7cdc1f2 This issue will close once commit 36520a2 is merged into the 'main' branch.36520a2 This issue will close once commit 75815a6 is merged into the 'main' branch.75815a6 This issue will close once commit 0518be5 is merged into the 'main' branch.0518be5
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|