~ubuntu-branches/ubuntu/natty/bzr/natty-proposed

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_transport.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-08-07 00:54:52 UTC
  • mfrom: (1.4.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100807005452-g4zb99ezl3xn44r4
Tags: 2.2.0-1
* New upstream release.
 + Adds support for setting timestamps to originating revisions.
   Closes: #473450
 + Removes remaining string exception. Closes: #585193, LP: #586926
 + Add C extension to work around Python issue 1628205. LP: #583941,
   Closes: #577110
 + Avoids showing progress bars when --quiet is used. Closes: #542105,
   LP: #320035
 + No longer creates ~/.bazaar as root when run under sudo. LP: #376388
 + 'bzr commit' now supports -p as alternative for --show-diff. LP: #571467
 + 'bzr add' no longer adds .THIS/.BASE/.THEIRS files unless
   explicitly requested. LP: #322767
 + When parsing patch files, Bazaar now supports diff lines before each
   patch. LP: #502076
 + WorkingTrees now no longer requires using signal.signal, so can
   be used in a threaded environment. LP: #521989
 + An assertion error is no longer triggered when pushing to a pre-1.6
   Bazaar server. LP: #528041
* Bump standards version to 3.9.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    TestNotApplicable,
53
53
    multiply_tests,
54
54
    )
 
55
from bzrlib.tests import test_server
55
56
from bzrlib.tests.test_transport import TestTransportImplementation
56
57
from bzrlib.transport import (
57
58
    ConnectedTransport,
170
171
        self.assertEqual(True, t.has_any(['b', 'b', 'b']))
171
172
 
172
173
    def test_has_root_works(self):
173
 
        from bzrlib.smart import server
174
 
        if self.transport_server is server.SmartTCPServer_for_testing:
 
174
        if self.transport_server is test_server.SmartTCPServer_for_testing:
175
175
            raise TestNotApplicable(
176
176
                "SmartTCPServer_for_testing intentionally does not allow "
177
177
                "access to /.")
1083
1083
        subdir.stat('./file')
1084
1084
        subdir.stat('.')
1085
1085
 
 
1086
    def test_hardlink(self):
 
1087
        from stat import ST_NLINK
 
1088
 
 
1089
        t = self.get_transport()
 
1090
 
 
1091
        source_name = "original_target"
 
1092
        link_name = "target_link"
 
1093
 
 
1094
        self.build_tree([source_name], transport=t)
 
1095
 
 
1096
        try:
 
1097
            t.hardlink(source_name, link_name)
 
1098
 
 
1099
            self.failUnless(t.has(source_name))
 
1100
            self.failUnless(t.has(link_name))
 
1101
 
 
1102
            st = t.stat(link_name)
 
1103
            self.failUnlessEqual(st[ST_NLINK], 2)
 
1104
        except TransportNotPossible:
 
1105
            raise TestSkipped("Transport %s does not support hardlinks." %
 
1106
                              self._server.__class__)
 
1107
 
 
1108
    def test_symlink(self):
 
1109
        from stat import S_ISLNK
 
1110
 
 
1111
        t = self.get_transport()
 
1112
 
 
1113
        source_name = "original_target"
 
1114
        link_name = "target_link"
 
1115
 
 
1116
        self.build_tree([source_name], transport=t)
 
1117
 
 
1118
        try:
 
1119
            t.symlink(source_name, link_name)
 
1120
 
 
1121
            self.failUnless(t.has(source_name))
 
1122
            self.failUnless(t.has(link_name))
 
1123
 
 
1124
            st = t.stat(link_name)
 
1125
            self.failUnless(S_ISLNK(st.st_mode))
 
1126
        except TransportNotPossible:
 
1127
            raise TestSkipped("Transport %s does not support symlinks." %
 
1128
                              self._server.__class__)
 
1129
        except IOError:
 
1130
            raise tests.KnownFailure("Paramiko fails to create symlinks during tests")
 
1131
 
1086
1132
    def test_list_dir(self):
1087
1133
        # TODO: Test list_dir, just try once, and if it throws, stop testing
1088
1134
        t = self.get_transport()