/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_version.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

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
 
"""Tests for versioning of bzrlib."""
 
17
"""Tests for versioning of breezy."""
18
18
 
19
 
from cStringIO import StringIO
20
19
import platform
21
20
import re
22
21
 
23
 
from bzrlib import (
 
22
from .. import (
24
23
    tests,
25
24
    version,
26
25
    workingtree,
27
26
    )
28
 
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
27
from ..sixish import (
 
28
    BytesIO,
 
29
    )
 
30
from .scenarios import load_tests_apply_scenarios
29
31
 
30
32
 
31
33
load_tests = load_tests_apply_scenarios
33
35
 
34
36
class TestBzrlibVersioning(tests.TestCase):
35
37
 
36
 
    def test_get_bzr_source_tree(self):
 
38
    def test_get_brz_source_tree(self):
37
39
        """Get tree for bzr source, if any."""
38
40
        self.permit_source_tree_branch_repo()
39
41
        # We don't know if these tests are being run from a checkout or branch
40
42
        # of bzr, from an installed copy, or from source unpacked from a
41
43
        # tarball.  We don't construct a branch just for testing this, so we
42
44
        # just assert that it must either return None or the tree.
43
 
        src_tree = version._get_bzr_source_tree()
 
45
        src_tree = version._get_brz_source_tree()
44
46
        if src_tree is None:
45
47
            raise tests.TestSkipped(
46
48
                "bzr tests aren't run from a bzr working tree")
50
52
 
51
53
    def test_python_binary_path(self):
52
54
        self.permit_source_tree_branch_repo()
53
 
        sio = StringIO()
 
55
        sio = BytesIO()
54
56
        version.show_version(show_config=False, show_copyright=False,
55
57
            to_file=sio)
56
58
        out = sio.getvalue()