/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_command.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-21 18:09:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1953.
  • Revision ID: john@arbash-meinel.com-20060821180932-d7d326b1982e2b62
Raise a reasonable error when a command is non-ascii

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
import errno
 
18
 
 
19
from bzrlib import (
 
20
    commands,
 
21
    errors,
 
22
    )
 
23
from bzrlib.commands import display_command
17
24
from bzrlib.tests import TestCase
18
 
from bzrlib.commands import display_command
19
 
import errno
 
25
 
20
26
 
21
27
class TestCommands(TestCase):
 
28
 
22
29
    def test_display_command(self):
23
30
        """EPIPE message is selectively suppressed"""
24
31
        def pipe_thrower():
33
40
            raise IOError(errno.ESPIPE, "Bogus pipe error")
34
41
        self.assertRaises(IOError, other_thrower)
35
42
 
 
43
    def test_unicode_command(self):
 
44
        self.assertRaises(errors.UnicodeCommand,
 
45
                          commands.run_bzr, [u'cmd\xb5'])