~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_setup.py

  • Committer: Olaf Conradi
  • Date: 2006-03-28 23:30:02 UTC
  • mto: (1661.1.1 bzr.mbp.remember)
  • mto: This revision was merged to the branch mainline in revision 1663.
  • Revision ID: olaf@conradi.org-20060328233002-f6262df0e19c1963
Added testcases for using pull with --remember. Moved remember code to
beginning of cmd_pull. This remembers the location in case of a failure
during pull.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
""" test for setup.py build process """
 
2
 
 
3
import os
 
4
import sys
 
5
import subprocess
 
6
import shutil
 
7
from tempfile import TemporaryFile
 
8
 
 
9
from bzrlib.tests import TestCase
 
10
 
 
11
 
 
12
# TODO: ideally run this in a separate directory, so as not to clobber the
 
13
# real build directory
 
14
 
 
15
class TestSetup(TestCase):
 
16
 
 
17
    def test_build(self):
 
18
        """ test cmd `python setup.py build`
 
19
        
 
20
        This typically catches new subdirectories which weren't added to setup.py
 
21
        """
 
22
        self.log('test_build running in %s' % os.getcwd())
 
23
        try:
 
24
            # run setup.py build as subproces and catch return code
 
25
            out_file = TemporaryFile()
 
26
            err_file = TemporaryFile()
 
27
            p = subprocess.Popen([sys.executable, 'setup.py', 'build'],
 
28
                                 stdout=out_file, stderr=err_file)
 
29
            s = p.communicate()
 
30
            self.assertEqual(0, p.returncode, '`python setup.py build` fails')
 
31
        finally:
 
32
            if os.path.exists('build'):
 
33
                shutil.rmtree(u'build')