[CalendarServer-changes] [2615] CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test. test_stream.patch
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jun 23 08:53:46 PDT 2008
Revision: 2615
http://trac.macosforge.org/projects/calendarserver/changeset/2615
Author: cdaboo at apple.com
Date: 2008-06-23 08:53:46 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
Test to make sure we don't hash None.
Added Paths:
-----------
CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_stream.patch
Added: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_stream.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_stream.patch (rev 0)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.test.test_stream.patch 2008-06-23 15:53:46 UTC (rev 2615)
@@ -0,0 +1,56 @@
+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())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080623/d318bfc7/attachment.htm
More information about the calendarserver-changes
mailing list