Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: third_party/gsutil/third_party/boto/tests/mturk/_init_environment.py

Issue 1380943003: Roll version of gsutil to 4.15. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 import os 1 import os
2 import functools 2 import functools
3 3
4 live_connection = False 4 live_connection = False
5 mturk_host = 'mechanicalturk.sandbox.amazonaws.com' 5 mturk_host = 'mechanicalturk.sandbox.amazonaws.com'
6 external_url = 'http://www.example.com/' 6 external_url = 'http://www.example.com/'
7 7
8 8
9 SetHostMTurkConnection = None 9 SetHostMTurkConnection = None
10 10
11 def config_environment(): 11 def config_environment():
12 global SetHostMTurkConnection 12 global SetHostMTurkConnection
13 try: 13 try:
14 local = os.path.join(os.path.dirname(__file__), 'local.py') 14 local = os.path.join(os.path.dirname(__file__), 'local.py')
15 execfile(local) 15 execfile(local)
16 except: 16 except:
17 pass 17 pass
18 18
19 if live_connection: 19 if live_connection:
20 #TODO: you must set the auth credentials to something valid 20 #TODO: you must set the auth credentials to something valid
21 from boto.mturk.connection import MTurkConnection 21 from boto.mturk.connection import MTurkConnection
22 else: 22 else:
23 # Here the credentials must be set, but it doesn't matter what 23 # Here the credentials must be set, but it doesn't matter what
24 # they're set to. 24 # they're set to.
25 os.environ.setdefault('AWS_ACCESS_KEY_ID', 'foo') 25 os.environ.setdefault('AWS_ACCESS_KEY_ID', 'foo')
26 os.environ.setdefault('AWS_SECRET_ACCESS_KEY', 'bar') 26 os.environ.setdefault('AWS_SECRET_ACCESS_KEY', 'bar')
27 from mocks import MTurkConnection 27 from mocks import MTurkConnection
28 SetHostMTurkConnection = functools.partial(MTurkConnection, host=mturk_host) 28 SetHostMTurkConnection = functools.partial(MTurkConnection, host=mturk_host)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698