~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_too_much.py

  • Committer: Aaron Bentley
  • Date: 2006-03-07 05:59:14 UTC
  • mfrom: (1558.1.20 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 1595.
  • Revision ID: aaron.bentley@utoronto.ca-20060307055914-a88728997afceb90
MergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
725
725
        assert '|||||||' not in conflict_text
726
726
        assert 'hi world' not in conflict_text
727
727
        os.unlink('hello.OTHER')
 
728
        os.unlink('question.OTHER')
 
729
        self.runbzr('remerge jello --merge-type weave', retcode=3)
728
730
        self.runbzr('remerge hello --merge-type weave', retcode=1)
729
731
        assert os.path.exists('hello.OTHER')
 
732
        self.assertIs(False, os.path.exists('question.OTHER'))
730
733
        file_id = self.runbzr('file-id hello')
731
734
        file_id = self.runbzr('file-id hello.THIS', retcode=3)
732
735
        self.runbzr('remerge --merge-type weave', retcode=1)
834
837
        self.runbzr('missing ../missing/new-branch')
835
838
 
836
839
    def test_external_command(self):
837
 
        """test that external commands can be run by setting the path"""
 
840
        """Test that external commands can be run by setting the path
 
841
        """
 
842
        # We don't at present run bzr in a subprocess for blackbox tests, and so 
 
843
        # don't really capture stdout, only the internal python stream.
 
844
        # Therefore we don't use a subcommand that produces any output or does
 
845
        # anything -- we just check that it can be run successfully.  
838
846
        cmd_name = 'test-command'
839
 
        output = 'Hello from test-command'
840
847
        if sys.platform == 'win32':
841
848
            cmd_name += '.bat'
842
 
            output += '\r\n'
843
 
        else:
844
 
            output += '\n'
845
 
 
846
849
        oldpath = os.environ.get('BZRPATH', None)
847
 
 
848
850
        bzr = self.capture
849
 
 
850
851
        try:
851
852
            if os.environ.has_key('BZRPATH'):
852
853
                del os.environ['BZRPATH']
856
857
                f.write('@echo off\n')
857
858
            else:
858
859
                f.write('#!/bin/sh\n')
859
 
            f.write('echo Hello from test-command')
 
860
            # f.write('echo Hello from test-command')
860
861
            f.close()
861
862
            os.chmod(cmd_name, 0755)
862
863
 
868
869
            os.environ['BZRPATH'] = '.'
869
870
 
870
871
            bzr(cmd_name)
871
 
            # The test suite does not capture stdout for external commands
872
 
            # this is because you have to have a real file object
873
 
            # to pass to Popen(stdout=FOO), and StringIO is not one of those.
874
 
            # (just replacing sys.stdout does not change a spawned objects stdout)
875
 
            #self.assertEquals(bzr(cmd_name), output)
876
872
 
877
873
            # Make sure empty path elements are ignored
878
874
            os.environ['BZRPATH'] = os.pathsep