Hi Remko,

technical questions like yours are better sent to Stack Overflow -- the
groups are for discussions that would not be welcome on stackoverflow.com
per their FAQ.

In this case you're probably able to use the solution already posted at
http://stackoverflow.com/questions/8130063/test-function-with-google-app-engine-files-api
so it's probably best not to post your Q there (it would be a duplicate).

If that solution doesn't work, however, then a new stackoverflow Q is
indeed appropriate
(specifically referring to that other Q and explaining what problems remain
after using the
approach in that Q's accepted and vastly-upvoted answer).  We sponsor and
monitor
(among others) the google-app-engine tag on stackoverflow and will do our
best to help there, if the existing solution does not meet your very
sensible requirements.

`testbed` is unfortunately rather undocumented (sorry!) but that's a
longer-term issue for us to fix... not something you should wait for!


Alex


On Wed, Mar 4, 2015 at 2:01 AM, <re...@el-tramo.be> wrote:

> Hi,
>
> I'm trying to write a unit test for file uploads in my (Python) API.
> I'm using the using the blobstore API to create an upload URL, as follows:
>     self.response.write(blobstore.create_upload_url(....))
>
> Everything works fine in production, but when using Testbed, I get the
> following URL back:
>
> http://testbed.example.com/_ah/upload/agx0ZXN0YmVkLXRlc3RyGwsSFV9fQmxvYlVwbG9hZFNlc3Npb25fXxgDDA
>
> Uploading to this URL from the test doesn't work, I get a 404. I should
> have initialized all stubs properly, amongst others:
>     self.testbed.init_datastore_v3_stub()
>     self.testbed.init_blobstore_stub()
>     self.testbed.init_files_stub()
>
> What am I doing wrong? How do I unit test file uploads?
>
> thanks,
> Remko
>
> --
> 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 google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-appengine.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-appengine/4bc5a934-20f9-419a-a990-fa923c5a53b6%40googlegroups.com
> <https://groups.google.com/d/msgid/google-appengine/4bc5a934-20f9-419a-a990-fa923c5a53b6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAE46Be_9_Sm%2B9RDMnRfF_ajuiOrU9q4haXWk87i_dA58zuFb8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to