File: test-unit-support.py

package info (click to toggle)
twill 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,472 kB
  • ctags: 1,916
  • sloc: python: 12,686; java: 98; makefile: 18; sh: 2
file content (31 lines) | stat: -rw-r--r-- 712 bytes parent folder | download | duplicates (4)
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()