~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

MergeĀ inĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
class TestWeave(TestCaseWithTransport, VersionedFileTestMixIn):
212
212
 
213
213
    def get_file(self, name='foo'):
214
 
        return WeaveFile(name, get_transport(self.get_url('.')))
 
214
        return WeaveFile(name, get_transport(self.get_url('.')), create=True)
215
215
 
216
216
    def get_file_corrupted_text(self):
217
 
        w = WeaveFile('foo', get_transport(self.get_url('.')))
 
217
        w = WeaveFile('foo', get_transport(self.get_url('.')), create=True)
218
218
        w.add_lines('v1', [], ['hello\n'])
219
219
        w.add_lines('v2', ['v1'], ['hello\n', 'there\n'])
220
220
        
250
250
    def reopen_file(self, name='foo'):
251
251
        return WeaveFile(name, get_transport(self.get_url('.')))
252
252
 
 
253
    def test_no_implicit_create(self):
 
254
        self.assertRaises(errors.NoSuchFile,
 
255
                          WeaveFile,
 
256
                          'foo',
 
257
                          get_transport(self.get_url('.')))
 
258
 
253
259
 
254
260
class TestKnit(TestCaseWithTransport, VersionedFileTestMixIn):
255
261
 
256
262
    def get_file(self, name='foo'):
257
263
        return KnitVersionedFile(name, get_transport(self.get_url('.')),
258
 
                                 delta=True)
 
264
                                 delta=True, create=True)
259
265
 
260
266
    def get_file_corrupted_text(self):
261
267
        knit = self.get_file()
271
277
        knit = self.get_file()
272
278
        knit.check()
273
279
 
 
280
    def test_no_implicit_create(self):
 
281
        self.assertRaises(errors.NoSuchFile,
 
282
                          KnitVersionedFile,
 
283
                          'foo',
 
284
                          get_transport(self.get_url('.')))
 
285
 
274
286
 
275
287
class InterString(versionedfile.InterVersionedFile):
276
288
    """An inter-versionedfile optimised code path for strings.