Esempio n. 1
0
    def testSlotsMigration(self):
        # leftslots and rightslots have been class variables ones. Make sure
        # using old instances without these properties doesn't break.

        # New instances should have the properties
        new = InstalledProduct('new')
        self.failUnless(hasattr(new, 'leftslots'))
        self.failUnless(hasattr(new, 'rightslots'))

        # Now emulate an old instance
        old = InstalledProduct('old')
        del (old.leftslots)
        del (old.rightslots)

        # Make sure calling the API will give you no error but silently
        # add the property
        left = old.getLeftSlots()
        self.failUnless(left == [])
        self.failUnless(old.leftslots == [])

        right = old.getRightSlots()
        self.failUnless(right == [])
        self.failUnless(old.rightslots == [])

        slots = old.getSlots()
        self.failUnless(slots == [])
Esempio n. 2
0
    def testSlotsMigration(self):
        # leftslots and rightslots have been class variables ones. Make sure
        # using old instances without these properties doesn't break.

        # New instances should have the properties
        new = InstalledProduct("new")
        self.failUnless(hasattr(new, "leftslots"))
        self.failUnless(hasattr(new, "rightslots"))

        # Now emulate an old instance
        old = InstalledProduct("old")
        del (old.leftslots)
        del (old.rightslots)

        # Make sure calling the API will give you no error but silently
        # add the property
        left = old.getLeftSlots()
        self.failUnless(left == [])
        self.failUnless(old.leftslots == [])

        right = old.getRightSlots()
        self.failUnless(right == [])
        self.failUnless(old.rightslots == [])

        slots = old.getSlots()
        self.failUnless(slots == [])
    def testSlotsMigration(self):
        from Products.CMFQuickInstallerTool.InstalledProduct import \
            InstalledProduct
        # leftslots and rightslots have been class variables ones. Make sure
        # using old instances without these properties doesn't break.

        # New instances should have the properties
        new = InstalledProduct('new')
        self.assertTrue(hasattr(new, 'leftslots'))
        self.assertTrue(hasattr(new, 'rightslots'))

        # Now emulate an old instance
        old = InstalledProduct('old')
        del(old.leftslots)
        del(old.rightslots)

        # Make sure calling the API will give you no error but silently
        # add the property
        left = old.getLeftSlots()
        self.assertTrue(left == [])
        self.assertTrue(old.leftslots == [])

        right = old.getRightSlots()
        self.assertTrue(right == [])
        self.assertTrue(old.rightslots == [])

        slots = old.getSlots()
        self.assertTrue(slots == [])