/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/blackbox/test_command_encoding.py

  • Committer: Martin von Gagern
  • Date: 2010-04-20 08:47:38 UTC
  • mfrom: (5167 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5195.
  • Revision ID: martin.vgagern@gmx.net-20100420084738-ygymnqmdllzrhpfn
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for the Command.encoding_type interface."""
18
18
 
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