~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: Martin Pool
  • Date: 2005-09-20 04:59:34 UTC
  • mfrom: (1185.1.32)
  • mto: (1185.8.2)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050920045934-2b9a193376bc9b7e
- merge integration from robertc
robertc@robertcollins.net-20050919064054-0da08709ee180b79

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
 
18
from cStringIO import StringIO
18
19
import logging
19
20
import unittest
20
21
import tempfile
21
22
import os
22
23
import sys
23
24
import errno
24
 
from warnings import warn
25
 
from cStringIO import StringIO
26
 
 
 
25
import subprocess
 
26
import shutil
27
27
import testsweet
 
28
 
28
29
import bzrlib.commands
29
 
 
30
30
import bzrlib.trace
31
31
import bzrlib.fetch
32
32
 
95
95
        """Shortcut that splits cmd into words, runs, and returns stdout"""
96
96
        return self.run_bzr_captured(cmd.split())[0]
97
97
 
98
 
 
99
98
    def run_bzr_captured(self, argv, retcode=0):
100
99
        """Invoke bzr and return (result, stdout, stderr).
101
100
 
140
139
            self.assertEquals(result, retcode)
141
140
        return out, err
142
141
 
143
 
 
144
142
    def run_bzr(self, *args, **kwargs):
145
143
        """Invoke bzr, as if it were run from the command line.
146
144
 
154
152
        retcode = kwargs.pop('retcode', 0)
155
153
        return self.run_bzr_captured(args, retcode)
156
154
 
157
 
 
158
155
    def check_inventory_shape(self, inv, shape):
159
156
        """
160
157
        Compare an inventory to a list of expected names.
270
267
        os.chdir(self._currentdir)
271
268
        super(TestCaseInTempDir, self).tearDown()
272
269
 
273
 
    
274
270
    def build_tree(self, shape):
275
271
        """Build a test tree according to a pattern.
276
272
 
288
284
                f = file(name, 'wt')
289
285
                print >>f, "contents of", name
290
286
                f.close()
291
 
                
292
287
 
293
288
 
294
289
class MetaTestLog(TestCase):
329
324
                   'bzrlib.selftest.testbranch',
330
325
                   'bzrlib.selftest.testremotebranch',
331
326
                   'bzrlib.selftest.testrevision',
 
327
                   'bzrlib.selftest.test_revision_info',
332
328
                   'bzrlib.selftest.test_merge_core',
333
329
                   'bzrlib.selftest.test_smart_add',
 
330
                   'bzrlib.selftest.test_bad_files',
334
331
                   'bzrlib.selftest.testdiff',
335
332
                   'bzrlib.selftest.test_xml',
336
333
                   'bzrlib.fetch',