[google-appengine] How to test with webtest and multiprocessing in GAE

2014-08-06 Thread puriketu99
Hello,experts.

Please tell me how to solve a following problem.
I would like to use webtest with multiprocess but it fails.
result

==FAIL: 
test_answer 
(testlab.LabTestCase)--Traceback
 (most recent call last):
  File "/Library/Python/2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
  File "/Users/unko/dropbox/test/testlab.py", line 48, in test_answer
self.assertEqual(u.param,"bar")AssertionError: 'foo' != 'bar'
--

testlab.py

#!-*- coding: utf-8 -*-
import unittestimport webtestimport webapp2from google.appengine.ext import 
testbed,ndbimport jsonimport timefrom google.appengine.api import 
apiproxy_stub_map from google.appengine.api import urlfetch_stub from mock 
import patch, Mockfrom google.appengine.ext import dbfrom lab import Labfrom 
lab import Unkoimport multiprocessing

class LabTestCase(unittest.TestCase):
  def setUp(self):
app = webapp2.WSGIApplication([
  ('/lab', Lab),
  ('/(.*)', Lab)
],debug=True)
self.testapp = webtest.TestApp(app)
self.testbed = testbed.Testbed()
self.testbed.setup_env(app_id='sagifugoh')
self.testbed.activate()
self.testbed.init_datastore_v3_stub()
self.testbed.init_memcache_stub()
self.testbed.init_channel_stub()
self.testbed.init_urlfetch_stub()
  def tearDown(self):
self.testbed.deactivate()
  @patch('google.appengine.api.urlfetch.urlfetch_service_pb.URLFetchResponse')
  def test_answer(self, URLFetchResponse):
def request(param):
  response = self.testapp.post('/lab',{"key":"key","param":param})
def async(param):
  p = multiprocessing.Process(target=request,args=[param])
  jobs.append(p)
  p.start()
jobs = []
u = Unko.get_or_insert("key")
u.param = "foo"
u.put()
async("bar")
time.sleep(2)
self.assertEqual(u.param,"bar")
if __name__ == '__main__':
  unittest.main()

lab.py

#!-*- coding: utf-8 -*-import webapp2from google.appengine.ext import db
class Unko(db.Model):
  param = db.StringProperty()
class Lab(webapp2.RequestHandler):
  def post(self):
key =  self.request.get('key')
param = self.request.get('param')
u = Unko.get_or_insert(key)
u.param = param
u.put()

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] AppEngine / GCS / Cloudstorage API - Is it possible to modify the ACL's and serve files directly from GCS?

2014-08-06 Thread Kaan Soral
Probably a warm instance, I've checked the logs, no cold instance warnings, 
however since warmup requests are enabled, no way to be sure, but since 
it's happening always, I'm assuming the instances are warm

The SO question is actually pretty good, but the answer seems dodgy, the 
question is about features, the answer is only directed at caching

I'm not acquainted to RTS protocols, it would be great if the answer 
included which protocols are supported in different scenarios

My concern isn't bandwidth but the user experience instead, the videos are 
played only in full screen on iOS phones, in order for the full screen 
playback to start, the request is waited, therefore there is a ~10 second 
delay between a video trigger and the playback

I should probably find a way to force the video UI to show directly at iOS 
devices for the time being, I'm using the webkit component, so not much 
flexibility there, might not even be possible

I've set the min and max request delays to 10ms's on instance settings, 
there is also 3 idle F2 instances, not much traffic, but still the 
responses aren't snappy anywhere

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Google Code issue tracker cleanup

2014-08-06 Thread pdknsk
Wow, the good news keep rolling in. I apologise if this is an inappropriate 
question, but does the App Engine team have a relatively high fluctuation 
of Managers, or just so many of them. I'm not really familiar with job 
descriptions at big corporations.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Google Code issue tracker cleanup

2014-08-06 Thread Kaan Soral
Yey! I'm one of those who urged the issue tracker usage at every feedback 
form and survey :)

Would be great to finally get more use of the issue tracker

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Google Code issue tracker cleanup

2014-08-06 Thread PK
This is great and thanks for taking the time to communicate the effort here. I 
hope you will keep it up. 

PK

> On Jul 9, 2014, at 5:48 PM, "Jesse Scherer (Google)"  
> wrote:
> 
> Over the past few years we have fallen behind on updating our issue tracker 
> on Google Code. But since getting feedback from our users is vital to us, we 
> will be renewing our focus on making the tracker useful to you.
> 
> We must work through the large number of open issues which exist today. Many 
> of the older issues issues represent popular feature requests, but others 
> were opened long ago and are no longer relevant to the person who opened them 
> or to the App Engine community.
> 
> We wish to fix this so that developers can easily find and follow issues 
> which apply to them. So, over the next few weeks we will review open issues 
> and close those that are obsolete and merge related issues together when 
> possible.
> 
> There is much work to do here, and in some cases we may inadvertently close 
> issues which are still relevant and important. If an issue which affects you 
> is closed and marked as obsolete or as a duplicate of another issue, please 
> comment on the issue so we can take another look.
> 
> How you can help
> --
> 
> 1. Check for a duplicate first. If so, star that issue. We often do sorts by 
> number of stars, so if it's a common issue, lots of duplicates can cause us 
> to miss it
> 
> 2. Write a clear, concise bug report. This is a report that needs to be read 
> several times. Write very clearly reproduction steps, OS, SDK version and 
> post code if you can. If we can't understand the bug report, we will close 
> it. 
> 
> 3. Follow up. We will sometimes post questions in the bug. If we don't 
> receive a response, we will close the bug. Also - if it turns out to be user 
> error, it helps us a lot if you post your fix. This sometimes helps us expose 
> places where we can improve our documentation.
> 
> Thank you all in advance for your support and commitment.
> 
> -- 
> Jesse Scherer | Technical Program Manager | jsche...@google.com
> 
> -- 
> 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.
> 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.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Static files not being served appengine 1.9.7 in Windows Vista 32-bit

2014-08-06 Thread Mars Lan
I'm unable to reproduce the issue using 1.9.8 on Vista 32-bit. Did you make 
any changes to minishell's app.yaml file?


On Monday, July 28, 2014 9:10:42 PM UTC-7, Ronald Harris wrote:
>
> Seems to be a problem serving static files with the latest appengine, 
> 1.9.7, in Windows Vista 32-bit.  The best evidence I can site for the bug 
> is that even the minishell demo PHP application doesn't work.  These is 
> what shows in the Chrome console:
>
> Failed to load resource: the server responded with a status of 500 
> (Internal Server Error) http://localhost:15080/static/style.css
> Failed to load resource: the server responded with a status of 500 
> (Internal Server Error) 
> http://localhost:15080/static/appengine_button_noborder.gif
>
> Is this a known bug?  Something specific to Windows or Windows Vista? Is 
> there a fix?
>
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] twittergae - new MIT licensed python code for twitter API access from GAE apps

2014-08-06 Thread Doug Anderson
twittergae is new MIT licensed python code for interfacing to the twitter 
api from GAE

   - It's relatively lightweight
   - Uses native GAE APIs directly such as urlfetch()
   - Supports sync, async, and ndb-async for any call
   - Supports "update_with_media"... yes multipart upload (embedded photo 
   upload) IS supported!

*Example... send a tweet:*

from twittergae.tweets import Tweets

# Initialize with your twitter credentials
tweets = Tweets(TWITTER_API_KEY,
 TWITTER_API_SECRET_KEY,
 TWITTER_ACCESS_TOKEN,
 TWITTER_ACCESS_SECRET_TOKEN)
tweets.update('Hello Twitterverse from twittergae')

*Developed for:*
https://www.sooshi.com

See example tweets: @sooshicom 

*Source code and additional examples on Github:*
https://github.com/claystreet/twittergae

I hope you find it useful!

 - Doug Anderson

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] How to deleteServingUrl when created with GcsFilename and not BlobKey?

2014-08-06 Thread Jarrod Roberson
There doesn't seem to be a way to delete a ImagesService servingUrl when it 
is created with the new ServingUrlOptions.googleStorageFileName?

I have posted a question on Stackoverflow and I can't find any mention of 
this anywhere on the internet other than 

*Version 1.7.0 - June 26, 2012*
   
   - *You can now use get_serving_url() and delete_serving_url() for Google 
   Cloud Storage buckets.*
   
*But I can't find a method that accepts a GcsFilename object?*

http://stackoverflow.com/questions/25172516/deleting-a-servingurl-created-from-a-gcsfilename-instead-of-a-blobkey-doesnt-se

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Expected BEGIN_OBJECT but was STRING at line 1 column 1

2014-08-06 Thread Bishan Buddhika


I'm getting below error from my google app engine program. But when i run 
this program on my PC, it's working without any errors. Below error is 
getting when uploaded to google app engine and run from there.

> com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: 
> Expected BEGIN_OBJECT but was STRING at line 1 column 1


Here is the link for my question with code snippets.

http://stackoverflow.com/questions/25157962/expected-begin-object-but-was-string-at-line-1-column-1

 

-- 
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.
For more options, visit https://groups.google.com/d/optout.