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

  • Committer: John Arbash Meinel
  • Date: 2006-10-16 01:50:48 UTC
  • mfrom: (2078 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: john@arbash-meinel.com-20061016015048-0f22df07e38093da
[merge] bzr.dev 2078

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
        self.assertEqual(cwd, osutils.getcwd())
361
361
 
362
362
 
 
363
class _DontSpawnProcess(Exception):
 
364
    """A simple exception which just allows us to skip unnecessary steps"""
 
365
 
 
366
 
 
367
class TestRunBzrSubprocessCommands(TestCaseWithTransport):
 
368
 
 
369
    def _popen(self, *args, **kwargs):
 
370
        """Record the command that is run, so that we can ensure it is correct"""
 
371
        self._popen_args = args
 
372
        self._popen_kwargs = kwargs
 
373
        raise _DontSpawnProcess()
 
374
 
 
375
    def test_run_bzr_subprocess_no_plugins(self):
 
376
        self.assertRaises(_DontSpawnProcess, self.run_bzr_subprocess)
 
377
        command = self._popen_args[0]
 
378
        self.assertEqual(sys.executable, command[0])
 
379
        self.assertEqual(self.get_bzr_path(), command[1])
 
380
        self.assertEqual(['--no-plugins'], command[2:])
 
381
 
 
382
    def test_allow_plugins(self):
 
383
        self.assertRaises(_DontSpawnProcess,
 
384
                          self.run_bzr_subprocess, allow_plugins=True)
 
385
        command = self._popen_args[0]
 
386
        self.assertEqual([], command[2:])
 
387
 
 
388
 
363
389
class TestBzrSubprocess(TestCaseWithTransport):
364
390
 
365
391
    def test_start_and_stop_bzr_subprocess(self):