1# Required for Python to search this directory for module files 2 3# This __init__.py makes unit testing easier by allowing us to treat the entire server as one big module. 4# This file is only accessed when not on AppEngine itself. 5 6# Make sure that this module will load in that case by including paths to 7# the default Google AppEngine install. 8 9 10def fix_sys_path(): 11 import sys 12 import os 13 14 # AppEngine imports a bunch of google-specific modules. Thankfully the dev_appserver 15 # knows how to do the same. Re-use the dev_appserver fix_sys_path logic to import 16 # all the google.appengine.* stuff so we can run under test-webkitpy 17 sys.path.append("/usr/local/google_appengine") 18 import dev_appserver 19 dev_appserver.fix_sys_path() 20 21 # test-webkitpy adds $WEBKIT/WebKitTools to the sys.path and imports 22 # QueueStatusServer to run all the tests. However, when AppEngine runs 23 # our code QueueStatusServer is the root (and thus in the path). 24 # Emulate that here for test-webkitpy so that we can import "model." 25 # not "QueueStatusServer.model.", etc. 26 sys.path.append(os.path.dirname(__file__)) 27 28 29fix_sys_path() 30