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

  • Committer: Robert Collins
  • Date: 2006-03-03 02:09:49 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060303020949-0ddc6f33d0a43943
Smoke test for RevisionStore factories creating revision stores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import sys
5
5
import subprocess
6
6
import shutil
7
 
from tempfile import TemporaryFile
8
7
 
9
8
from bzrlib.tests import TestCase
10
9
 
11
10
 
12
 
# TODO: ideally run this in a separate directory, so as not to clobber the
13
 
# real build directory
14
 
 
15
11
class TestSetup(TestCase):
16
12
 
 
13
    def setUp(self):
 
14
        pass
 
15
 
17
16
    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')
 
17
        """ test cmd `python setup.py build` """
 
18
        # run setup.py build as subproces and catch return code
 
19
        p = subprocess.Popen([sys.executable, 'setup.py', 'build'],
 
20
                stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
21
        s = p.communicate()
 
22
        self.assertEqual(0, p.returncode, '`python setup.py build` fails')
 
23
 
 
24
    def tearDown(self):
 
25
        """ cleanup build directory """
 
26
        shutil.rmtree(u'build')