1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
"""
Test the unit-test support framework using (naturally) a unit test...
"""
import os
import twilltestlib
import twill.unit
import twilltestserver
from quixote.server.simple_server import run as quixote_run
def test():
return 1
# port to run the server on
PORT=8090
# create a function to run the server
def run_server_fn():
quixote_run(twilltestserver.create_publisher, port=PORT)
# abspath to the script
script = os.path.join(twilltestlib.testdir, 'test-unit-support.twill')
# create test_info object
test_info = twill.unit.TestInfo(script, run_server_fn, PORT)
# run tests!
twill.unit.run_test(test_info)
if __name__ == '__main__':
test()
|