~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_script.py

Support '...' in expected strings.

* bzrlib/tests/test_script.py:
(TestScriptExecution.test_ellipsis_output): '...' can be used to
under specified expected outout/errors.

* bzrlib/tests/script.py:
(ScriptRunner.__init__, ScriptRunner._check_output): Use
doctest.OutputChecker.

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
        self.assertRaises(AssertionError, self.run_script, story)
98
98
 
99
99
 
 
100
    def test_ellipsis_output(self):
 
101
        story = """
 
102
cat
 
103
<first line
 
104
<second line
 
105
<last line
 
106
>first line
 
107
>...
 
108
>last line
 
109
"""
 
110
        self.run_script(story)
 
111
        story = """
 
112
bzr not-a-command
 
113
2>..."not-a-command"
 
114
"""
 
115
        self.run_script(story)
 
116
 
 
117
        story = """
 
118
bzr branch not-a-branch
 
119
2>bzr: ERROR: Not a branch...not-a-branch/".
 
120
"""
 
121
        self.run_script(story)
 
122
 
 
123
 
100
124
class TestCat(script.TestCaseWithTransportAndScript):
101
125
 
102
126
    def test_cat_usage(self):