~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Aaron Bentley
  • Date: 2006-09-19 16:26:17 UTC
  • mfrom: (2022 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2162.
  • Revision ID: abentley@panoramicfeedback.com-20060919162617-e6099afb05b6a9ef
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
import time
44
44
 
45
45
 
 
46
from bzrlib import memorytree
46
47
import bzrlib.branch
47
48
import bzrlib.bzrdir as bzrdir
48
49
import bzrlib.commands
931
932
            for env_var, value in old_env.iteritems():
932
933
                osutils.set_or_unset_env(env_var, value)
933
934
 
934
 
        bzr_path = os.path.dirname(os.path.dirname(bzrlib.__file__))+'/bzr'
935
 
        if not os.path.isfile(bzr_path):
936
 
            # We are probably installed. Assume sys.argv is the right file
937
 
            bzr_path = sys.argv[0]
 
935
        bzr_path = self.get_bzr_path()
938
936
 
939
937
        try:
940
938
            # win32 subprocess doesn't support preexec_fn
942
940
            # make sure the code path is used, and we don't break on win32
943
941
            cleanup_environment()
944
942
            process = Popen([sys.executable, bzr_path] + list(process_args),
945
 
                             stdout=PIPE, stderr=PIPE)
 
943
                             stdin=PIPE, stdout=PIPE, stderr=PIPE)
946
944
        finally:
947
945
            restore_environment()
948
946
        return process
949
947
 
 
948
    def get_bzr_path(self):
 
949
        """Return the path of the 'bzr' executable for this test suite."""
 
950
        bzr_path = os.path.dirname(os.path.dirname(bzrlib.__file__))+'/bzr'
 
951
        if not os.path.isfile(bzr_path):
 
952
            # We are probably installed. Assume sys.argv is the right file
 
953
            bzr_path = sys.argv[0]
 
954
        return bzr_path
 
955
 
950
956
    def finish_bzr_subprocess(self, process, retcode=0, send_signal=None,
951
957
                              universal_newlines=False, process_args=None):
952
958
        """Finish the execution of process.
1318
1324
        made_control = self.make_bzrdir(relpath, format=format)
1319
1325
        return made_control.create_repository(shared=shared)
1320
1326
 
 
1327
    def make_branch_and_memory_tree(self, relpath):
 
1328
        """Create a branch on the default transport and a MemoryTree for it."""
 
1329
        b = self.make_branch(relpath)
 
1330
        return memorytree.MemoryTree.create_on_branch(b)
 
1331
 
1321
1332
    def make_branch_and_tree(self, relpath, format=None):
1322
1333
        """Create a branch on the transport and a tree locally.
1323
1334
 
1475
1486
                   'bzrlib.tests.test_errors',
1476
1487
                   'bzrlib.tests.test_escaped_store',
1477
1488
                   'bzrlib.tests.test_fetch',
 
1489
                   'bzrlib.tests.test_ftp_transport',
1478
1490
                   'bzrlib.tests.test_gpg',
1479
1491
                   'bzrlib.tests.test_graph',
1480
1492
                   'bzrlib.tests.test_hashcache',
1488
1500
                   'bzrlib.tests.test_lockdir',
1489
1501
                   'bzrlib.tests.test_lockable_files',
1490
1502
                   'bzrlib.tests.test_log',
 
1503
                   'bzrlib.tests.test_memorytree',
1491
1504
                   'bzrlib.tests.test_merge',
1492
1505
                   'bzrlib.tests.test_merge3',
1493
1506
                   'bzrlib.tests.test_merge_core',
1512
1525
                   'bzrlib.tests.test_selftest',
1513
1526
                   'bzrlib.tests.test_setup',
1514
1527
                   'bzrlib.tests.test_sftp_transport',
1515
 
                   'bzrlib.tests.test_ftp_transport',
1516
1528
                   'bzrlib.tests.test_smart_add',
 
1529
                   'bzrlib.tests.test_smart_transport',
1517
1530
                   'bzrlib.tests.test_source',
1518
1531
                   'bzrlib.tests.test_status',
1519
1532
                   'bzrlib.tests.test_store',
1526
1539
                   'bzrlib.tests.test_transform',
1527
1540
                   'bzrlib.tests.test_transport',
1528
1541
                   'bzrlib.tests.test_tree',
 
1542
                   'bzrlib.tests.test_treebuilder',
1529
1543
                   'bzrlib.tests.test_tsort',
1530
1544
                   'bzrlib.tests.test_tuned_gzip',
1531
1545
                   'bzrlib.tests.test_ui',