~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_testament.py

 * The internal storage of history, and logical branch identity have now
   been split into Branch, and Repository. The common locking and file 
   management routines are now in bzrlib.lockablefiles. 
   (Aaron Bentley, Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

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