~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-09 01:16:57 UTC
  • mfrom: (1752.1.4 configobj)
  • Revision ID: pqm@pqm.ubuntu.com-20060609011657-d676366b38b5689b
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import logging
34
34
import os
35
35
import re
 
36
import shlex
36
37
import stat
 
38
from subprocess import Popen, PIPE
37
39
import sys
38
40
import tempfile
39
41
import unittest
719
721
            encoding = bzrlib.user_encoding
720
722
        return self.run_bzr(*args, **kwargs)[0].decode(encoding)
721
723
 
 
724
    def run_bzr_external(self, *args, **kwargs):
 
725
        bzr_path = os.path.dirname(os.path.dirname(bzrlib.__file__))+'/bzr'
 
726
        if len(args) == 1:
 
727
            args = shlex.split(args[0])
 
728
        args = list(args)
 
729
        process = Popen([bzr_path]+args, stdout=PIPE, stderr=PIPE)
 
730
        out = process.stdout.read()
 
731
        err = process.stderr.read()
 
732
        retcode = process.wait()
 
733
        supplied_retcode = kwargs.get('retcode')
 
734
        if supplied_retcode is not None:
 
735
            assert supplied_retcode == retcode
 
736
        else:
 
737
            assert retcode == 0
 
738
        return [out, err]
 
739
 
722
740
    def check_inventory_shape(self, inv, shape):
723
741
        """Compare an inventory to a list of expected names.
724
742