~vila/bzr/353370-notty-no-term-width

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_version.py

Merge jam's fix for termios import

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
 
18
17
"""Tests for versioning of bzrlib."""
19
18
 
 
19
from cStringIO import StringIO
 
20
import os
 
21
import re
 
22
 
20
23
from bzrlib import version, workingtree
21
24
from bzrlib.tests import TestCase, TestSkipped
22
25
 
35
38
        else:
36
39
            # ensure that what we got was in fact a working tree instance.
37
40
            self.assertIsInstance(src_tree, workingtree.WorkingTree)
 
41
 
 
42
    def test_python_binary_path(self):
 
43
        self.permit_source_tree_branch_repo()
 
44
        sio = StringIO()
 
45
        version.show_version(show_config=False, show_copyright=False,
 
46
            to_file=sio)
 
47
        out = sio.getvalue()
 
48
        m = re.search(r"Python interpreter: (.*) [0-9]", out)
 
49
        self.assertIsNot(m, None)
 
50
        self.failUnlessExists(m.group(1))