~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_transport.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
251
251
 
252
252
    def test_get_bytes_unknown_file(self):
253
253
        t = self.get_transport()
254
 
 
255
254
        self.assertRaises(NoSuchFile, t.get_bytes, 'c')
256
255
 
257
256
    def test_get_with_open_write_stream_sees_all_content(self):
1122
1121
            self.failUnless(t.has(link_name))
1123
1122
 
1124
1123
            st = t.stat(link_name)
1125
 
            self.failUnless(S_ISLNK(st.st_mode))
 
1124
            self.failUnless(S_ISLNK(st.st_mode),
 
1125
                "expected symlink, got mode %o" % st.st_mode)
1126
1126
        except TransportNotPossible:
1127
1127
            raise TestSkipped("Transport %s does not support symlinks." %
1128
1128
                              self._server.__class__)
1265
1265
        self.assertIs(t._get_connection(), c._get_connection())
1266
1266
 
1267
1267
        # Temporary failure, we need to create a new dummy connection
1268
 
        new_connection = object()
 
1268
        new_connection = None
1269
1269
        t._set_connection(new_connection)
1270
1270
        # Check that both transports use the same connection
1271
1271
        self.assertIs(new_connection, t._get_connection())
1765
1765
        # also raise a special error
1766
1766
        self.assertListRaises((errors.ShortReadvError, errors.InvalidRange),
1767
1767
                              transport.readv, 'a', [(12,2)])
 
1768
 
 
1769
    def test_stat_symlink(self):
 
1770
        # if a transport points directly to a symlink (and supports symlinks
 
1771
        # at all) you can tell this.  helps with bug 32669.
 
1772
        t = self.get_transport()
 
1773
        try:
 
1774
            t.symlink('target', 'link')
 
1775
        except TransportNotPossible:
 
1776
            raise TestSkipped("symlinks not supported")
 
1777
        t2 = t.clone('link')
 
1778
        st = t2.stat('')
 
1779
        self.assertTrue(stat.S_ISLNK(st.st_mode))