~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_versionedfile.py

(gz) Fix test failure on alpha by correcting format string for
 gc_chk_sha1_record (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
904
904
        # we should be able to read from http with a versioned file.
905
905
        vf = self.get_file()
906
906
        # try an empty file access
907
 
        readonly_vf = self.get_factory()('foo',
908
 
            transport.get_transport_from_url(self.get_readonly_url('.')))
 
907
        readonly_vf = self.get_factory()('foo', transport.get_transport(
 
908
                self.get_readonly_url('.')))
909
909
        self.assertEqual([], readonly_vf.versions())
910
910
 
911
911
    def test_readonly_http_works_with_feeling(self):
914
914
        # now with feeling.
915
915
        vf.add_lines('1', [], ['a\n'])
916
916
        vf.add_lines('2', ['1'], ['b\n', 'a\n'])
917
 
        readonly_vf = self.get_factory()('foo',
918
 
            transport.get_transport_from_url(self.get_readonly_url('.')))
 
917
        readonly_vf = self.get_factory()('foo', transport.get_transport(
 
918
                self.get_readonly_url('.')))
919
919
        self.assertEqual(['1', '2'], vf.versions())
920
920
        self.assertEqual(['1', '2'], readonly_vf.versions())
921
921
        for version in readonly_vf.versions():
1482
1482
        else:
1483
1483
            return ('FileA',) + (suffix,)
1484
1484
 
1485
 
    def test_add_fallback_implies_without_fallbacks(self):
1486
 
        f = self.get_versionedfiles('files')
1487
 
        if getattr(f, 'add_fallback_versioned_files', None) is None:
1488
 
            raise TestNotApplicable("%s doesn't support fallbacks"
1489
 
                                    % (f.__class__.__name__,))
1490
 
        g = self.get_versionedfiles('fallback')
1491
 
        key_a = self.get_simple_key('a')
1492
 
        g.add_lines(key_a, [], ['\n'])
1493
 
        f.add_fallback_versioned_files(g)
1494
 
        self.assertTrue(key_a in f.get_parent_map([key_a]))
1495
 
        self.assertFalse(key_a in f.without_fallbacks().get_parent_map([key_a]))
1496
 
 
1497
1485
    def test_add_lines(self):
1498
1486
        f = self.get_versionedfiles()
1499
1487
        key0 = self.get_simple_key('r0')