I'm really confused with the way to try Datastore in local. Please, give me 
a minute to explain.

I'm developing a app composed to few microservices like a only gae app. In 
a  parte of the app, I use the datastore. So when I run my app, I use the 
development server and when I save something in the datastore calling some 
method I can see perfectly the entity in the gae's admin web portal.

Well, now, instead of calling directly to ndb library and his methods I've 
built a  small library over ndb to abstract his functionallity, then I can 
call insertUser() instead of work directly with ndb. So, the problems 
appear when I try test this small library that I built (I've written a 
test.py file to do this).
At first, I thought  that this does not  can work because this test was 
executing without the deveserver running. After I searched info about how 
simulated the datastore in the local and I found this, but after I found 
too the unittest in local with the stubs, and now I don't understand 
nothing. 

I've tried both (gcloud datastore emulator and stub with unittest)  and I 
don't get  do simple example:
I want test that a entity is saved in Datastore and after I want test that 
I can read this entity

I suppose that dev_server (in SDK) emulate the datastore (because I can see 
the list of my entities there), but then, why use the datastore emulator in 
local dev?, and then, why is necesary uses the stub to datastore if we have 
a datastore emulator to do all test that I want? I don't understand.

I understand that maybe my question is more of concepts than code but I 
need understand really right how is the best way to work with this.

LocalDev Server --> 
https://cloud.google.com/appengine/docs/python/tools/using-local-server
UnitTest with Stub --> 
https://cloud.google.com/appengine/docs/python/tools/localunittesting
DataStore Emulator --> 
https://cloud.google.com/datastore/docs/tools/datastore-emulator

Thanks you so much, any help will be welcome :)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/cd123e20-c5fc-4faa-8717-49ddd012bd22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to