[Zope3-checkins] CVS: Zope3/src/zope/app/content/tests - test_image.py:1.7 test_zptpage.py:1.13

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Aug 6 11:45:49 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/content/tests
In directory cvs.zope.org:/tmp/cvs-serv18235/app/content/tests

Modified Files:
	test_image.py test_zptpage.py 
Log Message:
Mainly I18n of the ISized adapters.


=== Zope3/src/zope/app/content/tests/test_image.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/content/tests/test_image.py:1.6	Mon Apr 14 13:15:20 2003
+++ Zope3/src/zope/app/content/tests/test_image.py	Wed Aug  6 10:45:14 2003
@@ -136,20 +136,25 @@
         from zope.app.content.image import ImageSized
         s = ImageSized(DummyImage(0, 0, 0))
         self.assertEqual(s.sizeForSorting(), ('byte', 0))
-        self.assertEqual(s.sizeForDisplay(), u'0 KB 0x0')
-
+        self.assertEqual(s.sizeForDisplay(), u'0 KB ${width}x${height}')
+        self.assertEqual(s.sizeForDisplay().mapping['width'], '0')
+        self.assertEqual(s.sizeForDisplay().mapping['height'], '0')
 
     def test_arbitrarySize(self):
         from zope.app.content.image import ImageSized
         s = ImageSized(DummyImage(34, 56, 78))
         self.assertEqual(s.sizeForSorting(), ('byte', 78))
-        self.assertEqual(s.sizeForDisplay(), u'1 KB 34x56')
+        self.assertEqual(s.sizeForDisplay(), u'1 KB ${width}x${height}')
+        self.assertEqual(s.sizeForDisplay().mapping['width'], '34')
+        self.assertEqual(s.sizeForDisplay().mapping['height'], '56')
 
     def test_unknownSize(self):
         from zope.app.content.image import ImageSized
         s = ImageSized(DummyImage(-1, -1, 23))
         self.assertEqual(s.sizeForSorting(), ('byte', 23))
-        self.assertEqual(s.sizeForDisplay(), u'1 KB ?x?')
+        self.assertEqual(s.sizeForDisplay(), u'1 KB ${width}x${height}')
+        self.assertEqual(s.sizeForDisplay().mapping['width'], '?')
+        self.assertEqual(s.sizeForDisplay().mapping['height'], '?')
 
 def test_suite():
     return unittest.TestSuite((


=== Zope3/src/zope/app/content/tests/test_zptpage.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/content/tests/test_zptpage.py:1.12	Sun Jun  1 11:59:30 2003
+++ Zope3/src/zope/app/content/tests/test_zptpage.py	Wed Aug  6 10:45:14 2003
@@ -151,7 +151,8 @@
         from zope.app.content.zpt import Sized
         s = Sized(DummyZPT(''))
         self.assertEqual(s.sizeForSorting(), ('line', 0))
-        self.assertEqual(s.sizeForDisplay(), u'0 lines')
+        self.assertEqual(s.sizeForDisplay(), u'${lines} lines')
+        self.assertEqual(s.sizeForDisplay().mapping, {'lines': '0'})
 
     def test_oneSized(self):
         from zope.app.content.zpt import Sized
@@ -163,7 +164,8 @@
         from zope.app.content.zpt import Sized
         s = Sized(DummyZPT('some line\n'*5))
         self.assertEqual(s.sizeForSorting(), ('line', 5))
-        self.assertEqual(s.sizeForDisplay(), u'5 lines')
+        self.assertEqual(s.sizeForDisplay(), u'${lines} lines')
+        self.assertEqual(s.sizeForDisplay().mapping, {'lines': '5'})
 
 
 class TestFileEmulation(unittest.TestCase):




More information about the Zope3-Checkins mailing list