~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_testament.py

  • Committer: Mark Hammond
  • Date: 2008-08-10 11:16:39 UTC
  • mto: (3606.5.3 1.6)
  • mto: This revision was merged to the branch mainline in revision 3626.
  • Revision ID: mhammond@skippinet.com.au-20080810111639-9upz1wig1s8lvz62
install all files with 'restartreplace uninsrestartdelete' and close
tbzrcache at uninstall time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Test testaments for gpg signing."""
18
18
 
19
19
# TODO: Testaments with x-bits
20
20
 
21
21
import os
 
22
from sha import sha
22
23
 
23
 
from bzrlib import osutils
24
24
from bzrlib.tests import SymlinkFeature, TestCaseWithTransport
25
25
from bzrlib.testament import Testament, StrictTestament, StrictTestament3
26
26
from bzrlib.transform import TreeTransform
141
141
        inventory = self.b.repository.get_inventory('test@user-2')
142
142
        testament_1 = self.testament_class()(revision, inventory)
143
143
        text_1 = testament_1.as_short_text()
144
 
        text_2 = self.from_revision(self.b.repository,
 
144
        text_2 = self.from_revision(self.b.repository, 
145
145
                                    'test@user-2').as_short_text()
146
146
        self.assertEqual(text_1, text_2)
147
 
 
 
147
                    
148
148
 
149
149
class TestamentTestsStrict(TestamentTests):
150
 
 
 
150
    
151
151
    def testament_class(self):
152
152
        return StrictTestament
153
153
 
154
154
 
155
155
class TestamentTestsStrict2(TestamentTests):
156
 
 
 
156
    
157
157
    def testament_class(self):
158
158
        return StrictTestament3
159
159
 
211
211
bazaar-ng testament short form 1
212
212
revision-id: test@user-1
213
213
sha1: %s
214
 
""" % osutils.sha(REV_1_TESTAMENT).hexdigest()
 
214
""" % sha(REV_1_TESTAMENT).hexdigest()
215
215
 
216
216
 
217
217
REV_1_SHORT_STRICT = """\
218
218
bazaar-ng testament short form 2.1
219
219
revision-id: test@user-1
220
220
sha1: %s
221
 
""" % osutils.sha(REV_1_STRICT_TESTAMENT).hexdigest()
 
221
""" % sha(REV_1_STRICT_TESTAMENT).hexdigest()
222
222
 
223
223
 
224
224
REV_1_SHORT_STRICT3 = """\
225
225
bazaar testament short form 3 strict
226
226
revision-id: test@user-1
227
227
sha1: %s
228
 
""" % osutils.sha(REV_1_STRICT_TESTAMENT3).hexdigest()
 
228
""" % sha(REV_1_STRICT_TESTAMENT3).hexdigest()
229
229
 
230
230
 
231
231
REV_2_TESTAMENT = """\
293
293
bazaar-ng testament short form 1
294
294
revision-id: test@user-2
295
295
sha1: %s
296
 
""" % osutils.sha(REV_2_TESTAMENT).hexdigest()
 
296
""" % sha(REV_2_TESTAMENT).hexdigest()
297
297
 
298
298
 
299
299
REV_2_SHORT_STRICT = """\
300
300
bazaar-ng testament short form 2.1
301
301
revision-id: test@user-2
302
302
sha1: %s
303
 
""" % osutils.sha(REV_2_STRICT_TESTAMENT).hexdigest()
 
303
""" % sha(REV_2_STRICT_TESTAMENT).hexdigest()
304
304
 
305
305
 
306
306
REV_2_SHORT_STRICT3 = """\
307
307
bazaar testament short form 3 strict
308
308
revision-id: test@user-2
309
309
sha1: %s
310
 
""" % osutils.sha(REV_2_STRICT_TESTAMENT3).hexdigest()
 
310
""" % sha(REV_2_STRICT_TESTAMENT3).hexdigest()
311
311
 
312
312
 
313
313
REV_PROPS_TESTAMENT = """\