~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008, 2009, 2011 Canonical Ltd
 
1
# Copyright (C) 2007-2012, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
39
39
        output = self.run_bzr('version')[0]
40
40
        self.log('bzr version output:')
41
41
        self.log(output)
42
 
        self.assert_(output.startswith('Bazaar (bzr) '))
 
42
        self.assertTrue(output.startswith('Bazaar (bzr) '))
43
43
        self.assertNotEqual(output.index('Canonical'), -1)
44
44
        # make sure --version is consistent
45
45
        tmp_output = self.run_bzr('--version')[0]
46
 
        self.assertEquals(output, tmp_output)
 
46
        self.assertEqual(output, tmp_output)
47
47
 
48
48
    def test_version(self):
49
49
        self.permit_source_tree_branch_repo()
129
129
        self.assertTrue(len(out) > 0)
130
130
        self.assertContainsRe(out, r"(?m)^  Bazaar log file: " + bzr_log)
131
131
        self.assertPathDoesNotExist(default_log)
 
132
 
 
133
    def test_unicode_bzr_log(self):
 
134
        uni_val = u"\xa7"
 
135
        enc = osutils.get_user_encoding()
 
136
        try:
 
137
            str_val = uni_val.encode(enc)
 
138
        except UnicodeEncodeError:
 
139
            self.skip("Test string %r unrepresentable in user encoding %s" % (
 
140
                uni_val, enc))
 
141
        self.overrideEnv('BZR_HOME', self.test_base_dir)
 
142
        self.overrideEnv("BZR_LOG",
 
143
            os.path.join(self.test_base_dir, uni_val).encode(enc))
 
144
        out, err = self.run_bzr_subprocess("version")
 
145
        uni_out = out.decode(enc)
 
146
        self.assertContainsRe(uni_out, u"(?m)^  Bazaar log file: .*/\xa7$")
 
147
 
 
148