~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_chk_serializer.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-12-02 14:58:47 UTC
  • mfrom: (5554.1.3 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20101202145847-fw822sd3nyhvrwmi
(vila) Merge 2.2 into trunk including fix for bug #583667 and bug
        #681885 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

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