Esempio n. 1
0
 def testSeveralItems(self):
     from zope.container.size import ContainerSized
     obj = DummyContainer(2)
     sized = ContainerSized(obj)
     self.assertEqual(sized.sizeForSorting(), ('item', 2))
     self.assertEqual(sized.sizeForDisplay(), u'${items} items')
     self.assertEqual(sized.sizeForDisplay().mapping['items'], '2')
Esempio n. 2
0
 def testSeveralItems(self):
     from zope.container.size import ContainerSized
     obj = DummyContainer(2)
     sized = ContainerSized(obj)
     self.assertEqual(sized.sizeForSorting(), ('item', 2))
     self.assertEqual(sized.sizeForDisplay(), u'${items} items')
     self.assertEqual(sized.sizeForDisplay().mapping['items'], '2')
Esempio n. 3
0
 def testEmptyContainer(self):
     from zope.container.size import ContainerSized
     obj = DummyContainer(0)
     sized = ContainerSized(obj)
     self.assertEqual(sized.sizeForSorting(), ('item', 0))
     self.assertEqual(sized.sizeForDisplay(), u'${items} items')
     self.assertEqual(sized.sizeForDisplay().mapping['items'], '0')
Esempio n. 4
0
 def testEmptyContainer(self):
     from zope.container.size import ContainerSized
     obj = DummyContainer(0)
     sized = ContainerSized(obj)
     self.assertEqual(sized.sizeForSorting(), ('item', 0))
     self.assertEqual(sized.sizeForDisplay(), u'${items} items')
     self.assertEqual(sized.sizeForDisplay().mapping['items'], '0')
Esempio n. 5
0
    def testSeveralItems(self):
        from zope.container.size import ContainerSized

        obj = DummyContainer(2)
        sized = ContainerSized(obj)
        self.assertEqual(sized.sizeForSorting(), ("item", 2))
        self.assertEqual(sized.sizeForDisplay(), u"${items} items")
        self.assertEqual(sized.sizeForDisplay().mapping["items"], "2")
Esempio n. 6
0
    def testEmptyContainer(self):
        from zope.container.size import ContainerSized

        obj = DummyContainer(0)
        sized = ContainerSized(obj)
        self.assertEqual(sized.sizeForSorting(), ("item", 0))
        self.assertEqual(sized.sizeForDisplay(), u"${items} items")
        self.assertEqual(sized.sizeForDisplay().mapping["items"], "0")
Esempio n. 7
0
    def testOneItem(self):
        from zope.container.size import ContainerSized

        obj = DummyContainer(1)
        sized = ContainerSized(obj)
        self.assertEqual(sized.sizeForSorting(), ("item", 1))
        self.assertEqual(sized.sizeForDisplay(), u"1 item")
Esempio n. 8
0
 def testOneItem(self):
     from zope.container.size import ContainerSized
     obj = DummyContainer(1)
     sized = ContainerSized(obj)
     self.assertEqual(sized.sizeForSorting(), ('item', 1))
     self.assertEqual(sized.sizeForDisplay(), u'1 item')