~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_chk_serializer.py

  • Committer: Vincent Ladeuil
  • Date: 2017-01-17 13:48:10 UTC
  • mfrom: (6615.3.6 merges)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20170117134810-j9p3lidfy6pfyfsc
Merge 2.7, resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010, 2011, 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
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
 
from cStringIO import StringIO
18
 
 
19
 
from bzrlib import (
20
 
    errors,
21
 
    revision,
22
 
    serializer,
23
 
    )
24
17
from bzrlib.chk_serializer import (
25
18
    chk_bencode_serializer,
26
19
    )
68
61
        """Test unpacking a revision"""
69
62
        rev = chk_bencode_serializer.read_revision_from_string(
70
63
                _working_revision_bencode1)
71
 
        self.assertEquals(rev.committer,
 
64
        self.assertEqual(rev.committer,
72
65
           "Canonical.com Patch Queue Manager <pqm@pqm.ubuntu.com>")
73
 
        self.assertEquals(rev.inventory_sha1,
 
66
        self.assertEqual(rev.inventory_sha1,
74
67
           "4a2c7fb50e077699242cf6eb16a61779c7b680a7")
75
 
        self.assertEquals(["pqm@pqm.ubuntu.com-20090514104039-kggemn7lrretzpvc",
 
68
        self.assertEqual(["pqm@pqm.ubuntu.com-20090514104039-kggemn7lrretzpvc",
76
69
            "jelmer@samba.org-20090510012654-jp9ufxquekaokbeo"],
77
70
            rev.parent_ids)
78
 
        self.assertEquals("(Jelmer) Move dpush to InterBranch.", rev.message)
79
 
        self.assertEquals("pqm@pqm.ubuntu.com-20090514113250-jntkkpminfn3e0tz",
 
71
        self.assertEqual("(Jelmer) Move dpush to InterBranch.", rev.message)
 
72
        self.assertEqual("pqm@pqm.ubuntu.com-20090514113250-jntkkpminfn3e0tz",
80
73
           rev.revision_id)
81
 
        self.assertEquals({"branch-nick": u"+trunk"}, rev.properties)
82
 
        self.assertEquals(3600, rev.timezone)
 
74
        self.assertEqual({"branch-nick": u"+trunk"}, rev.properties)
 
75
        self.assertEqual(3600, rev.timezone)
83
76
 
84
77
    def test_written_form_matches(self):
85
78
        rev = chk_bencode_serializer.read_revision_from_string(
90
83
    def test_unpack_revision_no_timezone(self):
91
84
        rev = chk_bencode_serializer.read_revision_from_string(
92
85
            _working_revision_bencode1_no_timezone)
93
 
        self.assertEquals(None, rev.timezone)
 
86
        self.assertEqual(None, rev.timezone)
94
87
 
95
88
    def assertRoundTrips(self, serializer, orig_rev):
96
89
        text = serializer.write_revision_to_string(orig_rev)
97
90
        new_rev = serializer.read_revision_from_string(text)
98
 
        self.assertEquals(orig_rev, new_rev)
 
91
        self.assertEqual(orig_rev, new_rev)
99
92
 
100
93
    def test_roundtrips_non_ascii(self):
101
94
        rev = Revision("revid1")