~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_testament.py

  • Committer: Vincent Ladeuil
  • Date: 2011-07-06 09:22:00 UTC
  • mfrom: (6008 +trunk)
  • mto: (6012.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6013.
  • Revision ID: v.ladeuil+lp@free.fr-20110706092200-7iai2mwzc0sqdsvf
MergingĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from bzrlib import osutils
24
24
from bzrlib.tests import SymlinkFeature, TestCaseWithTransport
25
 
from bzrlib.testament import Testament, StrictTestament, StrictTestament3
 
25
from bzrlib.testament import (
 
26
    Testament,
 
27
    StrictTestament,
 
28
    StrictTestament3,
 
29
    )
26
30
from bzrlib.transform import TreeTransform
27
31
 
28
32
 
136
140
        self.assertEqualDiff(
137
141
            self.expected('sample_unicode').encode('utf-8'), t.as_text())
138
142
 
 
143
    def test_from_tree(self):
 
144
        tree = self.b.repository.revision_tree('test@user-2')
 
145
        testament = self.testament_class().from_revision_tree(tree)
 
146
        text_1 = testament.as_short_text()
 
147
        text_2 = self.from_revision(self.b.repository,
 
148
                                    'test@user-2').as_short_text()
 
149
        self.assertEqual(text_1, text_2)
 
150
 
139
151
    def test___init__(self):
140
152
        revision = self.b.repository.get_revision('test@user-2')
141
 
        inventory = self.b.repository.get_inventory('test@user-2')
142
 
        testament_1 = self.testament_class()(revision, inventory)
 
153
        tree = self.b.repository.revision_tree('test@user-2')
 
154
        testament_1 = self.testament_class()(revision, tree)
143
155
        text_1 = testament_1.as_short_text()
144
156
        text_2 = self.from_revision(self.b.repository,
145
157
                                    'test@user-2').as_short_text()
211
223
bazaar-ng testament short form 1
212
224
revision-id: test@user-1
213
225
sha1: %s
214
 
""" % osutils.sha(REV_1_TESTAMENT).hexdigest()
 
226
""" % osutils.sha_string(REV_1_TESTAMENT)
215
227
 
216
228
 
217
229
REV_1_SHORT_STRICT = """\
218
230
bazaar-ng testament short form 2.1
219
231
revision-id: test@user-1
220
232
sha1: %s
221
 
""" % osutils.sha(REV_1_STRICT_TESTAMENT).hexdigest()
 
233
""" % osutils.sha_string(REV_1_STRICT_TESTAMENT)
222
234
 
223
235
 
224
236
REV_1_SHORT_STRICT3 = """\
225
237
bazaar testament short form 3 strict
226
238
revision-id: test@user-1
227
239
sha1: %s
228
 
""" % osutils.sha(REV_1_STRICT_TESTAMENT3).hexdigest()
 
240
""" % osutils.sha_string(REV_1_STRICT_TESTAMENT3)
229
241
 
230
242
 
231
243
REV_2_TESTAMENT = """\
293
305
bazaar-ng testament short form 1
294
306
revision-id: test@user-2
295
307
sha1: %s
296
 
""" % osutils.sha(REV_2_TESTAMENT).hexdigest()
 
308
""" % osutils.sha_string(REV_2_TESTAMENT)
297
309
 
298
310
 
299
311
REV_2_SHORT_STRICT = """\
300
312
bazaar-ng testament short form 2.1
301
313
revision-id: test@user-2
302
314
sha1: %s
303
 
""" % osutils.sha(REV_2_STRICT_TESTAMENT).hexdigest()
 
315
""" % osutils.sha_string(REV_2_STRICT_TESTAMENT)
304
316
 
305
317
 
306
318
REV_2_SHORT_STRICT3 = """\
307
319
bazaar testament short form 3 strict
308
320
revision-id: test@user-2
309
321
sha1: %s
310
 
""" % osutils.sha(REV_2_STRICT_TESTAMENT3).hexdigest()
 
322
""" % osutils.sha_string(REV_2_STRICT_TESTAMENT3)
311
323
 
312
324
 
313
325
REV_PROPS_TESTAMENT = """\