~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Aaron Bentley
  • Date: 2008-03-03 16:52:41 UTC
  • mfrom: (3144.3.11 fix-conflict-handling)
  • mto: This revision was merged to the branch mainline in revision 3250.
  • Revision ID: aaron@aaronbentley.com-20080303165241-0k2c7ggs6kr9q6hf
Merge with fix-conflict-handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
        self.assertRaises(errors.OutSideTransaction,
177
177
            inv.add_lines, 'foo', [], [])
178
178
 
 
179
    def test_supports_external_lookups(self):
 
180
        control = bzrdir.BzrDirFormat6().initialize(self.get_url())
 
181
        repo = weaverepo.RepositoryFormat6().initialize(control)
 
182
        self.assertFalse(repo._format.supports_external_lookups)
 
183
 
179
184
 
180
185
class TestFormat7(TestCaseWithTransport):
181
186
    
289
294
        self.assertRaises(errors.OutSideTransaction,
290
295
            inv.add_lines, 'foo', [], [])
291
296
 
 
297
    def test_supports_external_lookups(self):
 
298
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
 
299
        repo = weaverepo.RepositoryFormat7().initialize(control)
 
300
        self.assertFalse(repo._format.supports_external_lookups)
 
301
 
292
302
 
293
303
class TestFormatKnit1(TestCaseWithTransport):
294
304
    
404
414
        inv = repo.deserialise_inventory('other-rev-id', inv_xml)
405
415
        self.assertEqual('other-rev-id', inv.root.revision)
406
416
 
 
417
    def test_supports_external_lookups(self):
 
418
        repo = self.make_repository('.',
 
419
                format=bzrdir.format_registry.get('knit')())
 
420
        self.assertFalse(repo._format.supports_external_lookups)
 
421
 
407
422
 
408
423
class KnitRepositoryStreamTests(test_knit.KnitTests):
409
424
    """Tests for knitrepo._get_stream_as_bytes."""
677
692
        self.assertRaises(errors.OutSideTransaction,
678
693
            inv.add_lines, 'foo', [], [])
679
694
 
 
695
    def test_supports_external_lookups(self):
 
696
        format = bzrdir.BzrDirMetaFormat1()
 
697
        format.repository_format = knitrepo.RepositoryFormatKnit3()
 
698
        repo = self.make_repository('.', format=format)
 
699
        self.assertFalse(repo._format.supports_external_lookups)
 
700
 
680
701
 
681
702
class TestWithBrokenRepo(TestCaseWithTransport):
682
703
    """These tests seem to be more appropriate as interface tests?"""
1171
1192
        self.assertRaises(errors.RevisionNotPresent,
1172
1193
            missing_ghost.get_inventory, 'ghost')
1173
1194
 
 
1195
    def test_supports_external_lookups(self):
 
1196
        repo = self.make_repository('.', format=self.get_format())
 
1197
        self.assertFalse(repo._format.supports_external_lookups)
 
1198
 
1174
1199
 
1175
1200
class TestKnitPackSubtrees(TestKnitPackNoSubtrees):
1176
1201
 
1184
1209
            t.get('format').read())
1185
1210
 
1186
1211
 
 
1212
class TestDevelopment0(TestKnitPackNoSubtrees):
 
1213
 
 
1214
    def get_format(self):
 
1215
        return bzrdir.format_registry.make_bzrdir(
 
1216
            'development')
 
1217
 
 
1218
    def check_format(self, t):
 
1219
        self.assertEqualDiff(
 
1220
            "Bazaar development format 0 (needs bzr.dev from before 1.3)\n",
 
1221
            t.get('format').read())
 
1222
 
 
1223
 
 
1224
class TestDevelopment0Subtree(TestKnitPackNoSubtrees):
 
1225
 
 
1226
    def get_format(self):
 
1227
        return bzrdir.format_registry.make_bzrdir(
 
1228
            'development-subtree')
 
1229
 
 
1230
    def check_format(self, t):
 
1231
        self.assertEqualDiff(
 
1232
            "Bazaar development format 0 with subtree support "
 
1233
            "(needs bzr.dev from before 1.3)\n",
 
1234
            t.get('format').read())
 
1235
 
 
1236
 
1187
1237
class TestRepositoryPackCollection(TestCaseWithTransport):
1188
1238
 
1189
1239
    def get_format(self):