~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
679
679
        self.apply_redirected(out, err, None, bzrlib.tests.selftest, 
680
680
            test_suite_factory=factory)
681
681
        self.assertEqual([True], factory_called)
 
682
 
 
683
    def test_run_bzr_subprocess(self):
 
684
        """The run_bzr_helper_external comand behaves nicely."""
 
685
        result = self.run_bzr_subprocess('--version')
 
686
        result = self.run_bzr_subprocess('--version', retcode=None)
 
687
        self.assertContainsRe(result[0], 'is free software')
 
688
        self.assertRaises(AssertionError, self.run_bzr_subprocess, 
 
689
                          '--versionn')
 
690
        result = self.run_bzr_subprocess('--versionn', retcode=3)
 
691
        result = self.run_bzr_subprocess('--versionn', retcode=None)
 
692
        self.assertContainsRe(result[1], 'unknown command')
 
693
        err = self.run_bzr_subprocess('merge', '--merge-type', 'magic merge', 
 
694
                                      retcode=3)[1]
 
695
        self.assertContainsRe(err, 'No known merge type magic merge')