/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/__init__.py

  • Committer: Martin Pool
  • Date: 2007-09-21 06:02:45 UTC
  • mto: This revision was merged to the branch mainline in revision 2874.
  • Revision ID: mbp@sourcefrog.net-20070921060245-j6a3g6oxdbs1bdjn
Make run_bzr_decode undeprecated again, but put it in the particular test class
TestNonAscii that needs it.  Remove run_bzr(output_encoding) parameter.

run_bzr_decode now takes a specific parameter that says if we expect the
operation to fail with a UnicodeError, and we test for that in particular.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1378
1378
        :keyword working_dir: The directory to run the command in
1379
1379
        :keyword error_regexes: A list of expected error messages.  If
1380
1380
            specified they must be seen in the error output of the command.
1381
 
        :keyword output_encoding: Expected encoding of output from bzr.
1382
1381
        """
1383
1382
        out, err = self._run_bzr_autosplit(
1384
1383
            args=args,
1389
1388
            )
1390
1389
        for regex in error_regexes:
1391
1390
            self.assertContainsRe(err, regex)
1392
 
        if output_encoding:
1393
 
            out = out.decode(output_encoding)
1394
 
            err = err.decode(output_encoding)
1395
1391
        return out, err
1396
1392
 
1397
 
    @deprecated_method(zero_ninetytwo)
1398
 
    def run_bzr_decode(self, *args, **kwargs):
1399
 
        """Run bzr and decode the output into a particular encoding.
1400
 
 
1401
 
        Returns a string containing the stdout output from bzr.
1402
 
 
1403
 
        This is deprecated in favour of passing output_encoding to run_bzr
1404
 
        instead.
1405
 
        """
1406
 
        if 'encoding' in kwargs:
1407
 
            encoding = kwargs['encoding']
1408
 
        else:
1409
 
            encoding = bzrlib.user_encoding
1410
 
        return self.run_bzr(output_encoding=encoding,
1411
 
                *args, **kwargs)[0]
1412
 
 
1413
1393
    def run_bzr_error(self, error_regexes, *args, **kwargs):
1414
1394
        """Run bzr, and check that stderr contains the supplied regexes
1415
1395