OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is govered by a BSD-style |
| 3 # license that can be found in the LICENSE file or at |
| 4 # https://developers.google.com/open-source/licenses/bsd |
| 5 |
| 6 # pylint: disable=undefined-variable |
| 7 |
| 8 import os |
| 9 import sys |
| 10 |
| 11 # Using pretest_filename is magic, because it is available in the locals() of |
| 12 # the script which execfiles this file. |
| 13 # prefixing with 'pretest' to avoid name collisions in expect_tests. |
| 14 pretest_APPENGINE_ENV_PATH = os.path.join( |
| 15 os.path.dirname( |
| 16 os.path.dirname( |
| 17 os.path.dirname( |
| 18 os.path.dirname( |
| 19 os.path.abspath(pretest_filename))))), |
| 20 'google_appengine') |
| 21 sys.path.append(pretest_APPENGINE_ENV_PATH) |
| 22 |
| 23 # Crazy hack, because of appengine. |
| 24 # Importing dev_appserver is probably not officially supported and fix_sys_path |
| 25 # may be an implementation detail subject to change. |
| 26 import dev_appserver as pretest_dev_appserver |
| 27 pretest_dev_appserver.fix_sys_path() |
| 28 |
| 29 # Remove google_appengine SDK from sys.path after use |
| 30 sys.path.remove(pretest_APPENGINE_ENV_PATH) |
| 31 |
| 32 SDK_LIBRARY_PATHS = [ |
| 33 # This is not added by fix_sys_path. |
| 34 os.path.join(pretest_APPENGINE_ENV_PATH, 'lib', 'mox'), |
| 35 ] |
| 36 sys.path.extend(SDK_LIBRARY_PATHS) |
| 37 |
| 38 os.environ['SERVER_SOFTWARE'] = 'test ' + os.environ.get('SERVER_SOFTWARE', '') |
| 39 os.environ['CURRENT_VERSION_ID'] = 'test.123' |
OLD | NEW |