~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_script.py

  • Committer: Martin
  • Date: 2010-10-27 23:27:41 UTC
  • mto: This revision was merged to the branch mainline in revision 5518.
  • Revision ID: gzlist@googlemail.com-20101027232741-08684075trtt6d0t
Document test to make it clearer what exactly is being asserted

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
class TestExecution(script.TestCaseWithTransportAndScript):
162
162
 
163
163
    def test_unknown_command(self):
 
164
        """A clear error is reported for commands that aren't recognised
 
165
 
 
166
        Testing the attributes of the SyntaxError instance is equivalent to
 
167
        using traceback.format_exception_only and comparing with:
 
168
          File "<string>", line 1
 
169
            foo --frob
 
170
            ^
 
171
        SyntaxError: Command not found "foo"
 
172
        """
164
173
        e = self.assertRaises(SyntaxError, self.run_script, "$ foo --frob")
165
174
        self.assertContainsRe(e.msg, "not found.*foo")
166
175
        self.assertEquals(e.text, "foo --frob")