summaryrefslogtreecommitdiffstats
path: root/WebKitTools/QueueStatusServer/__init__.py
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2010-11-10 15:31:59 -0800
committerTeng-Hui Zhu <ztenghui@google.com>2010-11-17 13:35:59 -0800
commit28040489d744e0c5d475a88663056c9040ed5320 (patch)
treec463676791e4a63e452a95f0a12b2a8519730693 /WebKitTools/QueueStatusServer/__init__.py
parenteff9be92c41913c92fb1d3b7983c071f3e718678 (diff)
downloadexternal_webkit-28040489d744e0c5d475a88663056c9040ed5320.zip
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.gz
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.bz2
Merge WebKit at r71558: Initial merge by git.
Change-Id: Ib345578fa29df7e4bc72b4f00e4a6fddcb754c4c
Diffstat (limited to 'WebKitTools/QueueStatusServer/__init__.py')
-rw-r--r--WebKitTools/QueueStatusServer/__init__.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/WebKitTools/QueueStatusServer/__init__.py b/WebKitTools/QueueStatusServer/__init__.py
new file mode 100644
index 0000000..2346c23
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/__init__.py
@@ -0,0 +1,29 @@
+# Required for Python to search this directory for module files
+
+# This __init__.py makes unit testing easier by allowing us to treat the entire server as one big module.
+# This file is only accessed when not on AppEngine itself.
+
+# Make sure that this module will load in that case by including paths to
+# the default Google AppEngine install.
+
+
+def fix_sys_path():
+ import sys
+ import os
+
+ # AppEngine imports a bunch of google-specific modules. Thankfully the dev_appserver
+ # knows how to do the same. Re-use the dev_appserver fix_sys_path logic to import
+ # all the google.appengine.* stuff so we can run under test-webkitpy
+ sys.path.append("/usr/local/google_appengine")
+ import dev_appserver
+ dev_appserver.fix_sys_path()
+
+ # test-webkitpy adds $WEBKIT/WebKitTools to the sys.path and imports
+ # QueueStatusServer to run all the tests. However, when AppEngine runs
+ # our code QueueStatusServer is the root (and thus in the path).
+ # Emulate that here for test-webkitpy so that we can import "model."
+ # not "QueueStatusServer.model.", etc.
+ sys.path.append(os.path.dirname(__file__))
+
+
+fix_sys_path()