[Zope3-checkins] CVS: zopeproducts/demo/messageboard/step5/tests - test_size.py:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Dec 14 17:04:58 EST 2003


Update of /cvs-repository/zopeproducts/demo/messageboard/step5/tests
In directory cvs.zope.org:/tmp/cvs-serv22238/tests

Modified Files:
	test_size.py 
Log Message:
Forgot to make sure tests pass as well; now they do.


=== zopeproducts/demo/messageboard/step5/tests/test_size.py 1.1 => 1.2 ===
--- zopeproducts/demo/messageboard/step5/tests/test_size.py:1.1	Tue Jun 10 17:49:51 2003
+++ zopeproducts/demo/messageboard/step5/tests/test_size.py	Sun Dec 14 17:04:58 2003
@@ -17,12 +17,13 @@
 """
 import unittest
 from zope.app.interfaces.size import ISized
+from zope.app.tests.placelesssetup import PlacelessSetup
 from zopeproducts.messageboard.message import Message, MessageSized
 
 class Stub:
     pass
 
-class SizedTest(unittest.TestCase):
+class SizedTest(PlacelessSetup, unittest.TestCase):
 
     def test_interface(self):
         self.assert_(ISized.isImplementedBy(MessageSized(Message())))
@@ -30,25 +31,25 @@
     def test_sizeForSorting(self):
         size = MessageSized(Message())
         self.assertEqual(('item', 0), size.sizeForSorting())
-        size._message.setObject('msg1', Message()) 
+        size._message['msg1'] = Message()
         self.assertEqual(('item', 1), size.sizeForSorting())
-        size._message.setObject('att1', Stub()) 
+        size._message['att1'] = Stub()
         self.assertEqual(('item', 2), size.sizeForSorting())
 
     def test_sizeForDisplay(self):
         size = MessageSized(Message())
         self.assertEqual('0 replies, 0 attachments',
                          size.sizeForDisplay())
-        size._message.setObject('msg1', Message()) 
+        size._message['msg1'] = Message()
         self.assertEqual('1 reply, 0 attachments',
                          size.sizeForDisplay())
-        size._message.setObject('msg2', Message()) 
+        size._message['msg2'] =  Message()
         self.assertEqual('2 replies, 0 attachments',
                          size.sizeForDisplay())
-        size._message.setObject('att1', Stub()) 
+        size._message['att1'] = Stub()
         self.assertEqual('2 replies, 1 attachment',
                          size.sizeForDisplay())
-        size._message.setObject('att2', Stub()) 
+        size._message['att2'] = Stub()
         self.assertEqual('2 replies, 2 attachments',
                          size.sizeForDisplay())
 




More information about the Zope3-Checkins mailing list