Skip to content

Commit

Permalink
python 3: remove minor appengine.api.app_identity and memcache usages
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Nov 7, 2019
1 parent 93444f6 commit 6d247a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions old_apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""
import urlparse

from google.appengine.api import app_identity
import webapp2


Expand All @@ -13,7 +12,7 @@ def get(self):
parts[1] = 'granary-demo.appspot.com'

if parts[2].startswith('/@me/'):
site = app_identity.get_application_id().split('-')[0]
site = os.getenv('GAE_APPLICATION').split('-')[0]
parts[2] = site + parts[2]

return self.redirect(urlparse.urlunparse(parts), permanent=True)
Expand Down
6 changes: 2 additions & 4 deletions test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import oauth_dropins.webutil.tests
import appengine_config

from google.appengine.api import memcache
from oauth_dropins.webutil import testutil_appengine
from oauth_dropins.webutil.util import json_dumps, json_loads

Expand Down Expand Up @@ -203,19 +202,18 @@ def test_as2_format(self):
def test_atom_format(self):
for test_module in test_facebook, test_instagram, test_twitter:
self.reset()
memcache.flush_all()
self.mox.StubOutWithMock(FakeSource, 'get_actor')
FakeSource.get_actor(None).AndReturn(test_module.ACTOR)
self.activities = [copy.deepcopy(test_module.ACTIVITY)]

# include access_token param to check that it gets stripped
resp = self.get_response('/fake?format=atom&access_token=foo&a=b')
resp = self.get_response('/fake?format=atom&access_token=foo&a=b&cache=false')
self.assertEquals(200, resp.status_int)
self.assertEquals('application/atom+xml; charset=utf-8',
resp.headers['Content-Type'])
self.assert_multiline_equals(
test_module.ATOM % {
'request_url': 'http://localhost/fake?format=atom&access_token=foo&a=b',
'request_url': 'http://localhost/fake?format=atom&access_token=foo&a=b&cache=false',
'host_url': 'http://fa.ke/',
'base_url': 'http://fa.ke/',
},
Expand Down

0 comments on commit 6d247a3

Please sign in to comment.