~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_script.py

Script execution must stop on unexpected errors.

* bzrlib/tests/test_script.py:
(TestScriptExecution.test_stops_on_unexpected_error,
TestScriptExecution.test_continue_on_expected_error): Test
behaviour on errors.

* bzrlib/tests/script.py:
(ScriptRunner.run_command): Fail on unexpected errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
    def test_unknown_command(self):
89
89
        self.assertRaises(SyntaxError, self.run_script, 'foo')
90
90
 
91
 
    def test_unexpected_output(self):
 
91
    def test_stops_on_unexpected_output(self):
92
92
        story = """
93
93
mkdir dir
94
94
cd dir
97
97
        self.assertRaises(AssertionError, self.run_script, story)
98
98
 
99
99
 
 
100
    def test_stops_on_unexpected_error(self):
 
101
        story = """
 
102
cat
 
103
<Hello
 
104
bzr not-a-command
 
105
"""
 
106
        self.assertRaises(AssertionError, self.run_script, story)
 
107
 
 
108
    def test_continue_on_expected_error(self):
 
109
        story = """
 
110
bzr not-a-command
 
111
2>..."not-a-command"
 
112
"""
 
113
        self.run_script(story)
 
114
 
100
115
    def test_ellipsis_output(self):
101
116
        story = """
102
117
cat