Rev 55: Create a tests directory, update the TODOs. in http://bazaar.launchpad.net/%7Ebzr/bzr.webdav/webdav

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Jun 9 08:50:50 BST 2008


At http://bazaar.launchpad.net/%7Ebzr/bzr.webdav/webdav

------------------------------------------------------------
revno: 55
revision-id: v.ladeuil+lp at free.fr-20080609075046-9k3hzahkjjbjbki1
parent: v.ladeuil+lp at free.fr-20080608223542-c47y2fmxuj9jngyy
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: webdav
timestamp: Mon 2008-06-09 09:50:46 +0200
message:
  Create a tests directory, update the TODOs.
added:
  tests/                         tests-20080609071552-gad043bcol0e5b49-1
  tests/__init__.py              __init__.py-20080609073346-j4nbcf6e7i6s8503-1
renamed:
  test_webdav.py => tests/test_webdav.py test_webdav.py-20060823130244-qvg4wqdodnmf5nhs-1
modified:
  TODO                           todo-20060820113924-ioaocfzvsb4wq9z1-1
  __init__.py                    __init__.py-20060816232542-enpjxth2743ttqpq-2
  webdav.py                      webdav.py-20060816232542-enpjxth2743ttqpq-3
  tests/test_webdav.py           test_webdav.py-20060823130244-qvg4wqdodnmf5nhs-1
-------------- next part --------------
=== modified file 'TODO'
--- a/TODO	2008-06-08 19:34:35 +0000
+++ b/TODO	2008-06-09 07:50:46 +0000
@@ -4,7 +4,55 @@
 
 ** handle prop and allprop for file and directory as apache2
 
-* handle the TODOs in webdav.py
-
-** move the relevant TODOs in webdav.py and elsewhere here :)
+* webdav.py
+
+** get rid of the APPEND experiments, this is not going to be
+   supported anytime soon.
+
+** We can detect that the server do not accept "write" operations
+   (it will return 501) and raise InvalidHttpRequest(to be
+   defined as a daughter of InvalidHttpResponse) but what will
+   the upper layers do ?
+
+** 20060908 All *_file functions are defined in terms of *_bytes
+   because we have to read the file to create a proper PUT
+   request.  Is it possible to define PUT with a file-like
+   object, so that we don't have to potentially read in and hold
+   onto potentially 600MB of file contents?
+
+** Factor out the error handling. Try to use
+   Transport.translate_error if it becomes an accessible
+   function. Otherwise duplicate it here (bad)
+
+* tests
+
+** Move the server into its own file
+
+** Implement the testing of the range header for PUT requests
+   (GET request are already heavily tested in bzr). Test servers
+   are available there too. This will also help for reporting
+   bugs against lighttp.
+
+** Turning directory indexes off may make the server reports that
+   an existing directory does not exist. Reportedly, using
+   multiviews can provoke that too. Investigate and fix.
+
+**  A DAV web server can't handle mode on files because:
+
+    - there is nothing in the protocol for that,
+
+    - the  server  itself  generally  uses  the mode  for  its  own
+      purposes, except  if you  make it run  suid which  is really,
+      really   dangerous   (Apache    should   be   compiled   with
+      -D-DBIG_SECURITY_HOLE for those who didn't get the message).
+
+   That means this transport will do no better. May be the file
+   mode should be a file property handled explicitely inside the
+   repositories and applied by bzr in the working trees. That
+   implies a mean to store file properties, apply them, detecting
+   their changes, etc.
+
+   It may be possible to use PROPPATCH to handle mode bits, but
+   bzr doesn't try to handle remote working trees. So until the
+   neeed arises, this will remain as is.
 

=== modified file '__init__.py'
--- a/__init__.py	2008-06-07 15:13:23 +0000
+++ b/__init__.py	2008-06-09 07:50:46 +0000
@@ -47,15 +47,11 @@
                                       'HttpDavTransport')
 
 
-    def test_suite():
-        from bzrlib.tests import TestUtil
-
-        suite = TestUtil.TestSuite()
-        loader = TestUtil.TestLoader()
+    def load_tests(basic_tests, module, loader):
         testmod_names = [
-            'test_webdav',
+            'tests',
             ]
-
-        suite.addTest(loader.loadTestsFromModuleNames(
+        basic_tests.addTest(loader.loadTestsFromModuleNames(
                 ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
-        return suite
+        return basic_tests
+

=== added directory 'tests'
=== added file 'tests/__init__.py'
--- a/tests/__init__.py	1970-01-01 00:00:00 +0000
+++ b/tests/__init__.py	2008-06-09 07:50:46 +0000
@@ -0,0 +1,23 @@
+# Copyright (C) 2008 by Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+def load_tests(basic_tests, module, loader):
+    testmod_names = [
+        'test_webdav',
+        ]
+    basic_tests.addTest(loader.loadTestsFromModuleNames(
+            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
+    return basic_tests

=== renamed file 'test_webdav.py' => 'tests/test_webdav.py'
--- a/test_webdav.py	2008-06-08 22:35:42 +0000
+++ b/tests/test_webdav.py	2008-06-09 07:50:46 +0000
@@ -20,11 +20,6 @@
 implements the DAV specification parts used by the webdav plugin.
 """
 
-# TODO: Move the server into its own file
-
-# TODO: Implement the testing of the range header for PUT requests (GET request
-# are already heavily tested in bzr). Test servers are available there too.
-
 from cStringIO import StringIO
 import errno
 import httplib

=== modified file 'webdav.py'
--- a/webdav.py	2008-06-08 22:35:42 +0000
+++ b/webdav.py	2008-06-09 07:50:46 +0000
@@ -21,51 +21,6 @@
 This should enable remote push operations.
 """
 
-# FIXME: Turning directory indexes off may make the server
-# reports that an existing directory does not exist. Reportedly,
-# using multiviews can provoke that too. Investigate and fix.
-
-# FIXME: A DAV web server can't handle mode on files because:
-# - there is nothing in the protocol for that,
-# - the  server  itself  generally  uses  the mode  for  its  own
-#   purposes, except  if you  make it run  suid which  is really,
-#   really   dangerous   (Apache    should   be   compiled   with
-#   -D-DBIG_SECURITY_HOLE for those who didn't get the message).
-# That means  this transport will do  no better. May  be the file
-# mode should  be a file property handled  explicitely inside the
-# repositories  and applied  by bzr  in the  working  trees. That
-# implies a mean to  store file properties, apply them, detecting
-# their changes, etc.
-
-# TODO:   Cache  files   to   improve  performance   (a  bit   at
-# least). Files  should be kept  in a temporary directory  (or an
-# hash-based hierarchy to limit  local file systems problems) and
-# indexed  on  their  full  URL  to  allow  sharing  between  DAV
-# transport  instances. If the  full content  is not  cached, the
-# Content-Length header, if cached,  may avoid a roundtrip to the
-# server when appending.
-
-# TODO:  Try to  use Transport.translate_error  if it  becomes an
-# accessible function. Otherwise  duplicate it here (bad). Anyway
-# all translations of IOError and OSError should be factored.
-
-# TODO: Have the webdav plugin try to use APPEND, and if it isn't
-# available, permanently switch back to get + put for the life of
-# the Transport.
-
-# TODO:  We can  detect that  the  server do  not accept  "write"
-# operations (it will return 501) and raise InvalidHttpRequest(to
-# be defined as a  daughter of InvalidHttpResponse) but what will
-# the upper layers do ?
-
-# TODO: 20060908 All *_file functions are defined in terms of
-# *_bytes because we have to read the file to create a proper PUT
-# request.  Is it possible to define PUT with a file-like object,
-# so that we don't have to potentially read in and hold onto
-# potentially 600MB of file contents?
-
-# TODO: Factor out the error handling.
-
 from cStringIO import StringIO
 import os
 import random
@@ -911,8 +866,8 @@
 
 def get_test_permutations():
     """Return the permutations to be used in testing."""
-    import test_webdav
-    return [(HttpDavTransport, test_webdav.DAVServer),
+    import tests.test_webdav
+    return [(HttpDavTransport, tests.test_webdav.DAVServer),
             # Until the Dav transport try to use the APPEND
             # request, there is no need to activate the following
             # (HttpDavTransport, test_webdav.DAVServer_append),



More information about the bazaar-commits mailing list