~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_script.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-09 23:16:22 UTC
  • mfrom: (5422.3.9 scripts)
  • Revision ID: pqm@pqm.ubuntu.com-20101009231622-hk7zigkj84reyn2z
(mbp) empty output in shell-like tests is no longer a wildcard (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
    def test_unknown_command(self):
164
164
        self.assertRaises(SyntaxError, self.run_script, 'foo')
165
165
 
 
166
    def test_blank_output_mismatches_output(self):
 
167
        """If you give output, the output must actually be blank.
 
168
        
 
169
        See <https://bugs.launchpad.net/bzr/+bug/637830>: previously blank
 
170
        output was a wildcard.  Now you must say ... if you want that.
 
171
        """
 
172
        self.assertRaises(AssertionError,
 
173
            self.run_script,
 
174
            """
 
175
            $ echo foo
 
176
            """)
 
177
 
 
178
    def test_ellipsis_everything(self):
 
179
        """A simple ellipsis matches everything."""
 
180
        self.run_script("""
 
181
        $ echo foo
 
182
        ...
 
183
        """)
 
184
 
 
185
    def test_ellipsis_matches_empty(self):
 
186
        self.run_script("""
 
187
        $ cd .
 
188
        ...
 
189
        """)
 
190
 
166
191
    def test_stops_on_unexpected_output(self):
167
192
        story = """
168
193
$ mkdir dir
171
196
"""
172
197
        self.assertRaises(AssertionError, self.run_script, story)
173
198
 
174
 
 
175
199
    def test_stops_on_unexpected_error(self):
176
200
        story = """
177
201
$ cat
191
215
        # The status matters, not the output
192
216
        story = """
193
217
$ bzr init
 
218
...
194
219
$ cat >file
195
220
<Hello
196
221
$ bzr add file
 
222
...
197
223
$ bzr commit -m 'adding file'
 
224
2>...
198
225
"""
199
226
        self.run_script(story)
200
227
 
366
393
class TestBzr(script.TestCaseWithTransportAndScript):
367
394
 
368
395
    def test_bzr_smoke(self):
369
 
        self.run_script('$ bzr init branch')
 
396
        self.run_script("""
 
397
            $ bzr init branch
 
398
            Created a standalone tree (format: ...)
 
399
            """)
370
400
        self.failUnlessExists('branch')
371
401
 
372
402