Commit 32513056 authored by Marius Wachtler's avatar Marius Wachtler

Add pyxl hello world integration test

parent 12abc42b
......@@ -23,3 +23,6 @@
[submodule "test/integration/sqlalchemy"]
path = test/integration/sqlalchemy
url = https://github.com/zzzeek/sqlalchemy
[submodule "test/integration/pyxl"]
path = test/integration/pyxl
url = https://github.com/dropbox/pyxl.git
Subproject commit ebe32acd6f779069a6a9e03ca48c7eb5ffcd0831
import os
import sys
import subprocess
import shutil
ENV_NAME = "pyxl_test_env_" + os.path.basename(sys.executable)
if not os.path.exists(ENV_NAME) or os.stat(sys.executable).st_mtime > os.stat(ENV_NAME + "/bin/python").st_mtime:
print "Creating virtualenv to install testing dependencies..."
VIRTUALENV_SCRIPT = os.path.dirname(__file__) + "/virtualenv/virtualenv.py"
try:
args = [sys.executable, VIRTUALENV_SCRIPT, "-p", sys.executable, ENV_NAME]
print "Running", args
subprocess.check_call(args)
except:
print "Error occurred; trying to remove partially-created directory"
ei = sys.exc_info()
try:
subprocess.check_call(["rm", "-rf", ENV_NAME])
except Exception as e:
print e
raise ei[0], ei[1], ei[2]
PYXL_DIR = os.path.dirname(__file__) + "/pyxl"
python_exe = os.path.abspath(ENV_NAME + "/bin/python")
subprocess.check_call([python_exe, "setup.py", "build"], cwd=PYXL_DIR)
subprocess.check_call([python_exe, "setup.py", "install"], cwd=PYXL_DIR)
subprocess.check_call([python_exe, "finish_install.py"], cwd=PYXL_DIR)
out = subprocess.check_output([python_exe, "pyxl/examples/hello_world.py"], cwd=PYXL_DIR)
print
print "Output: '%s'" % out
assert out == "<html><body>Hello World!</body></html>\n"
print "PASSED"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment