Index: twisted/web2/dav/test/test_stream.py
===================================================================
--- twisted/web2/dav/test/test_stream.py	(revision 0)
+++ twisted/web2/dav/test/test_stream.py	(revision 0)
@@ -0,0 +1,51 @@
+##
+# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+##
+
+from twisted.trial import unittest
+from twisted.web2.stream import MemoryStream
+from twisted.web2.dav.stream import MD5StreamWrapper
+import md5
+
+class Stream(unittest.TestCase):
+    """
+    MD5StreamWrapper tests.
+    """
+    def test_simple(self):
+        """
+        Simple test
+        """
+        
+        data = """I am sorry Dave, I can't do that.
+--HAL 9000
+"""
+
+        datastream = MemoryStream(data)
+        stream = MD5StreamWrapper(datastream)
+        
+        while stream.read() is not None:
+            pass
+        stream.close()
+
+        m = md5.new()
+        m.update(data)
+        
+        self.assertEqual(m.hexdigest(), stream.getMD5())

Test to make sure we don't hash None.
Test to make sure we don't hash None.

git-svn-id: 81e381228600e5752b80483efd2b45b26c451ea2@2615 e27351fd-9f3e-4f54-a53b-843176b1656c
