File: test-shell.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 (33 lines) | stat: -rw-r--r-- 926 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
32
33
"""
Run through the test-basic script, but this time from the command interpreter.
"""

import sys, os
import twilltestlib
from cStringIO import StringIO
import twill.shell

def setup_module():
    global url
    url = twilltestlib.get_url()

def test_shell_specific():    
    twilltestlib.execute_twill_shell('test-shell.twill', initial_url=url,
                                     fail_on_unknown=True)

    try:
        twilltestlib.execute_twill_shell('test-shell-fail.twill',
                                         initial_url=url,
                                         fail_on_unknown=True)
    except NameError:
        pass
    
def test_most_commands():
    inp = "unique1\nunique2\n"
    twilltestlib.execute_twill_shell('test-basic.twill', inp, initial_url=url)
    
def teardown_module():
    try:
        os.unlink(os.path.join(twilltestlib.testdir, 'test-basic.cookies'))
    except OSError:
        pass