Skip to content

Commit b7c5a40

Browse files
author
Daniel Hermes
committed
Fixing oauth2client appengine test to account for new devappserver.
Reviewed in https://codereview.appspot.com/8358046/
1 parent 79daca0 commit b7c5a40

2 files changed

Lines changed: 15 additions & 16 deletions

File tree

tests/test_oauth2client_appengine.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,11 @@
3232
import urllib
3333

3434
try:
35-
from urlparse import parse_qs
35+
from urlparse import parse_qs
3636
except ImportError:
37-
from cgi import parse_qs
37+
from cgi import parse_qs
3838

3939
import dev_appserver
40-
_EXTRA_PATHS = dev_appserver.EXTRA_PATHS
41-
_DIR_PATH = _EXTRA_PATHS[0]
42-
_OLD_WEBOB = os.path.join(_DIR_PATH, 'lib', 'webob_0_9')
43-
_WEBOB_INDEX = _EXTRA_PATHS.index(_OLD_WEBOB)
44-
_NEW_WEBOB = os.path.join(_DIR_PATH, 'lib', 'webob-1.2.3')
45-
_EXTRA_PATHS[_WEBOB_INDEX] = _NEW_WEBOB
4640
dev_appserver.fix_sys_path()
4741
import webapp2
4842

@@ -91,16 +85,16 @@ def load_and_cache(existing_file, fakename, cache_mock):
9185

9286

9387
class CacheMock(object):
94-
def __init__(self):
95-
self.cache = {}
88+
def __init__(self):
89+
self.cache = {}
9690

97-
def get(self, key, namespace=''):
98-
# ignoring namespace for easier testing
99-
return self.cache.get(key, None)
91+
def get(self, key, namespace=''):
92+
# ignoring namespace for easier testing
93+
return self.cache.get(key, None)
10094

101-
def set(self, key, value, namespace=''):
102-
# ignoring namespace for easier testing
103-
self.cache[key] = value
95+
def set(self, key, value, namespace=''):
96+
# ignoring namespace for easier testing
97+
self.cache[key] = value
10498

10599

106100
class UserMock(object):

tox.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ deps = keyring
1010
webtest
1111
nose
1212
setenv = PYTHONPATH=../google_appengine
13+
14+
[testenv:py26]
15+
commands = nosetests --ignore-files=test_oauth2client_appengine\.py
16+
17+
[testenv:py27]
1318
commands = nosetests

0 commit comments

Comments
 (0)