~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_testament.py

first cut at merge from integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
    def test_null_testament(self):
56
56
        """Testament for a revision with no contents."""
57
 
        t = Testament.from_revision(self.b, 'test@user-1')
 
57
        t = Testament.from_revision(self.b.repository, 'test@user-1')
58
58
        ass = self.assertTrue
59
59
        eq = self.assertEqual
60
60
        ass(isinstance(t, Testament))
65
65
 
66
66
    def test_testment_text_form(self):
67
67
        """Conversion of testament to canonical text form."""
68
 
        t = Testament.from_revision(self.b, 'test@user-1')
 
68
        t = Testament.from_revision(self.b.repository, 'test@user-1')
69
69
        text_form = t.as_text()
70
70
        self.log('testament text form:\n' + text_form)
71
71
        self.assertEqual(text_form, REV_1_TESTAMENT)
72
72
 
73
73
    def test_testament_with_contents(self):
74
74
        """Testament containing a file and a directory."""
75
 
        t = Testament.from_revision(self.b, 'test@user-2')
 
75
        t = Testament.from_revision(self.b.repository, 'test@user-2')
76
76
        text_form = t.as_text()
77
77
        self.log('testament text form:\n' + text_form)
78
78
        self.assertEqualDiff(text_form, REV_2_TESTAMENT)
102
102
                 timezone=36000,
103
103
                 rev_id='test@user-3',
104
104
                 committer='test@user')
105
 
        t = Testament.from_revision(self.b, 'test@user-3')
 
105
        t = Testament.from_revision(self.b.repository, 'test@user-3')
106
106
        self.assertEqualDiff(t.as_text(), REV_3_TESTAMENT)
107
107
 
108
108
    def test_testament_revprops(self):
115
115
                      rev_id='test@user-3',
116
116
                      committer='test@user',
117
117
                      revprops=props)
118
 
        t = Testament.from_revision(self.b, 'test@user-3')
 
118
        t = Testament.from_revision(self.b.repository, 'test@user-3')
119
119
        self.assertEqualDiff(t.as_text(), REV_PROPS_TESTAMENT)
120
120
 
121
121
    def test___init__(self):
122
 
        revision = self.b.get_revision('test@user-2')
123
 
        inventory = self.b.get_inventory('test@user-2')
 
122
        revision = self.b.repository.get_revision('test@user-2')
 
123
        inventory = self.b.repository.get_inventory('test@user-2')
124
124
        testament_1 = Testament(revision, inventory).as_short_text()
125
 
        testament_2 = Testament.from_revision(self.b, 
 
125
        testament_2 = Testament.from_revision(self.b.repository, 
126
126
                                              'test@user-2').as_short_text()
127
127
        self.assertEqual(testament_1, testament_2)
128
128