~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_versionedfile.py

  • Committer: John Arbash Meinel
  • Date: 2011-01-12 21:27:00 UTC
  • mto: This revision was merged to the branch mainline in revision 5605.
  • Revision ID: john@arbash-meinel.com-20110112212700-esqmtrmevddxrsq2
Clean up the test slightly, hoping to avoid race conditions, update NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
751
751
        self.assertEquals(('references_ghost', 'line_c\n'), origins[2])
752
752
 
753
753
    def test_readonly_mode(self):
754
 
        t = self.get_transport()
 
754
        t = transport.get_transport(self.get_url('.'))
755
755
        factory = self.get_factory()
756
756
        vf = factory('id', t, 0777, create=True, access_mode='w')
757
757
        vf = factory('id', t, access_mode='r')
782
782
class TestWeave(TestCaseWithMemoryTransport, VersionedFileTestMixIn):
783
783
 
784
784
    def get_file(self, name='foo'):
785
 
        return WeaveFile(name, self.get_transport(),
 
785
        return WeaveFile(name, transport.get_transport(self.get_url('.')),
786
786
                         create=True,
787
787
                         get_scope=self.get_transaction)
788
788
 
789
789
    def get_file_corrupted_text(self):
790
 
        w = WeaveFile('foo', self.get_transport(),
 
790
        w = WeaveFile('foo', transport.get_transport(self.get_url('.')),
791
791
                      create=True,
792
792
                      get_scope=self.get_transaction)
793
793
        w.add_lines('v1', [], ['hello\n'])
823
823
        return w
824
824
 
825
825
    def reopen_file(self, name='foo', create=False):
826
 
        return WeaveFile(name, self.get_transport(),
 
826
        return WeaveFile(name, transport.get_transport(self.get_url('.')),
827
827
                         create=create,
828
828
                         get_scope=self.get_transaction)
829
829
 
831
831
        self.assertRaises(errors.NoSuchFile,
832
832
                          WeaveFile,
833
833
                          'foo',
834
 
                          self.get_transport(),
 
834
                          transport.get_transport(self.get_url('.')),
835
835
                          get_scope=self.get_transaction)
836
836
 
837
837
    def get_factory(self):
925
925
class TestWeaveHTTP(TestCaseWithWebserver, TestReadonlyHttpMixin):
926
926
 
927
927
    def get_file(self):
928
 
        return WeaveFile('foo', self.get_transport(),
 
928
        return WeaveFile('foo', transport.get_transport(self.get_url('.')),
929
929
                         create=True,
930
930
                         get_scope=self.get_transaction)
931
931
 
1177
1177
class TestWeaveMerge(TestCaseWithMemoryTransport, MergeCasesMixin):
1178
1178
 
1179
1179
    def get_file(self, name='foo'):
1180
 
        return WeaveFile(name, self.get_transport(),
 
1180
        return WeaveFile(name, transport.get_transport(self.get_url('.')),
1181
1181
                         create=True)
1182
1182
 
1183
1183
    def log_contents(self, w):
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')