~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_transport.py

  • Committer: Robert Collins
  • Date: 2010-02-27 12:27:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5061.
  • Revision ID: robertc@robertcollins.net-20100227122733-2o3me3fkk3pk36ns
``bzrlib.branchbuilder.BranchBuilder.build_snapshot`` now accepts a
``message_callback`` in the same way that commit does. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 
1132
1086
    def test_list_dir(self):
1133
1087
        # TODO: Test list_dir, just try once, and if it throws, stop testing
1134
1088
        t = self.get_transport()