~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_weave.py

  • Committer: Martin Pool
  • Date: 2005-09-19 10:22:06 UTC
  • Revision ID: mbp@sourcefrog.net-20050919102206-dc4a95dbbe908e2c
- caller can pass SHA-1 to Weave.add for efficiency

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
"""test suite for weave algorithm"""
25
25
 
 
26
from pprint import pformat
26
27
 
27
28
import testsweet
28
29
from bzrlib.weave import Weave, WeaveFormatError, WeaveError
29
30
from bzrlib.weavefile import write_weave, read_weave
30
31
from bzrlib.selftest import TestCase
31
 
from pprint import pformat
32
 
 
 
32
from bzrlib.osutils import sha_string
33
33
 
34
34
try:
35
35
    set
114
114
 
115
115
 
116
116
 
 
117
class AddWithGivenSha(TestBase):
 
118
    def runTest(self):
 
119
        """Add with caller-supplied SHA-1"""
 
120
        k = Weave()
 
121
 
 
122
        t = 'text0'
 
123
        k.add('text0', [], [t], sha1=sha_string(t))
 
124
 
 
125
 
 
126
 
117
127
class InvalidAdd(TestBase):
118
128
    """Try to use invalid version number during add."""
119
129
    def runTest(self):