/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_chk_serializer.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 01:35:53 UTC
  • mto: (6670.4.8 move-bzr)
  • mto: This revision was merged to the branch mainline in revision 6681.
  • Revision ID: jelmer@jelmer.uk-20170610013553-560y7mn3su4pp763
Fix remaining tests.

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
 
from bzrlib.chk_serializer import (
 
17
from ..chk_serializer import (
25
18
    chk_bencode_serializer,
26
19
    )
27
 
from bzrlib.revision import (
 
20
from ..revision import (
28
21
    Revision,
29
22
    )
30
 
from bzrlib.tests import TestCase
 
23
from . import TestCase
31
24
 
32
25
_working_revision_bencode1 = ('l'
33
26
    'l6:formati10ee'
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")