~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-05-18 18:20:31 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070518182031-gbg2cgidv5l20x9p
Takes Robert comments into account.

* bzrlib/transport/ftp.py:
(FtpTransport.__init__): Write a better explanation.

* bzrlib/tests/test_init.py:
(InstrumentedTransport): Just make hooks a class attribute.
(InstrumentedTransport._get_FTP): Run hook directly in the for
loop.
(TransportHooks.run_hook, TransportHooks.uninstall_hook): Not
needed. The hooks should be cleaned up by the test itself.
(TestInit.setUp.cleanup): Resset to default hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
        self.assertEqual(baz_path, osutils.dereference_path(foo_baz_path))
248
248
 
249
249
 
250
 
    def test_changing_access(self):
251
 
        f = file('file', 'w')
252
 
        f.write('monkey')
253
 
        f.close()
254
 
 
255
 
        # Make a file readonly
256
 
        osutils.make_readonly('file')
257
 
        mode = osutils.lstat('file').st_mode
258
 
        self.assertEqual(mode, mode & 0777555)
259
 
 
260
 
        # Make a file writable
261
 
        osutils.make_writable('file')
262
 
        mode = osutils.lstat('file').st_mode
263
 
        self.assertEqual(mode, mode | 0200)
264
 
 
265
 
        if osutils.has_symlinks():
266
 
            # should not error when handed a symlink
267
 
            os.symlink('nonexistent', 'dangling')
268
 
            osutils.make_readonly('dangling')
269
 
            osutils.make_writable('dangling')
270
 
 
271
 
 
272
250
    def test_kind_marker(self):
273
251
        self.assertEqual("", osutils.kind_marker("file"))
274
252
        self.assertEqual("/", osutils.kind_marker(osutils._directory_kind))