~jelmer/ubuntu/maverick/bzr/2.2.5

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_command_encoding.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-03-10 14:11:59 UTC
  • mfrom: (1.2.1 upstream) (3.1.68 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090310141159-lwzzo5c1fwrtzgj4
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
 
48
48
class TestCommandEncoding(TestCase):
49
 
    
 
49
 
50
50
    def test_exact(self):
51
51
        def bzr(*args, **kwargs):
52
52
            return self.run_bzr(*args, **kwargs)[0]
62
62
                bzr,
63
63
                ['echo-exact', u'foo\xb5'])
64
64
        finally:
65
 
            plugin_cmds.pop('echo-exact')
 
65
            plugin_cmds.remove('echo-exact')
66
66
 
67
67
    def test_strict_utf8(self):
68
68
        def bzr(*args, **kwargs):
75
75
            self.assertEqual(u'foo\xb5'.encode('utf-8'),
76
76
                             bzr(['echo-strict', u'foo\xb5']))
77
77
        finally:
78
 
            plugin_cmds.pop('echo-strict')
 
78
            plugin_cmds.remove('echo-strict')
79
79
 
80
80
    def test_strict_ascii(self):
81
81
        def bzr(*args, **kwargs):
90
90
                bzr,
91
91
                ['echo-strict', u'foo\xb5'])
92
92
        finally:
93
 
            plugin_cmds.pop('echo-strict')
 
93
            plugin_cmds.remove('echo-strict')
94
94
 
95
95
    def test_replace_utf8(self):
96
96
        def bzr(*args, **kwargs):
103
103
            self.assertEqual(u'foo\xb5'.encode('utf-8'),
104
104
                             bzr(['echo-replace', u'foo\xb5']))
105
105
        finally:
106
 
            plugin_cmds.pop('echo-replace')
 
106
            plugin_cmds.remove('echo-replace')
107
107
 
108
108
    def test_replace_ascii(self):
109
109
        def bzr(*args, **kwargs):
116
116
            # ascii can't encode \xb5
117
117
            self.assertEqual('foo?', bzr(['echo-replace', u'foo\xb5']))
118
118
        finally:
119
 
            plugin_cmds.pop('echo-replace')
 
119
            plugin_cmds.remove('echo-replace')
120
120
 
121
121