[Zope] Migrating the OpenFlow project from Zope 2.7.x to 2.9.x (and 2.10.x)

Marco Bizzarri marco.bizzarri at gmail.com
Sat Feb 10 15:33:43 EST 2007


Hi all.

I'm in the business of migrating OpenFlow from Zope 2.7.x (where it
lived peacefully) to Zope 2.9 and 2.10 (i.e. I'm in the process of
2.9, and then I will move to 2.10).

As a first step, I've run the unit tests for the project, and just one
is failing, the following one:

<code>
    def afterSetUp(self):
        self.zope = self.app
        # create an openflow
        self.zope.manage_addProduct['OpenFlow'].manage_addOpenflow(id='OF')
        self.of = getattr(self.zope, 'OF')
        # Create a Process Definition with two activities (Begin, End)...
        self.of.addProcess(id='begin_end', BeginEnd=1)
        self.pd = getattr(self.of, 'begin_end')
        # ...and one transition linking them
        self.pd.addTransition(id='begin_end', From='Begin', To='End')
        loginUnrestricted()

    def testCopyOpenflow(self):
        cataloged_items = len(self.of.Catalog())
        cb = self.zope.manage_copyObjects([self.of.id])
        try:
            for i in [self.of, self.pd] + self.pd.objectValues():
                assert hasattr(i.aq_base, 'getId'), "missing %s" % i.id
                assert i._getCopy(self.zope) is not None, "getcopy not
in %s" % i.id
        except AssertionError:
            # this test is tough to make! how to do this?
            return
        self.zope.manage_pasteObjects(cb)
        new_of = getattr(self.zope, 'copy_of_'+self.of.id)
        self.assertEquals(len(new_of.Catalog()),cataloged_items)
</code>

Just for a little of further knowledge: OpenFlow creates a Catalog,
which is used to access all the data of the Workflow (processes,
instancess, workitems, etc.)

The assertion failing is the last one, because I get a length of 0 as
a result of the query of the catalog.

Can someone point me to differences between 2.7 and 2.9 in the
handling of the paste action?

Regards
Marco

-- 
Marco Bizzarri
http://iliveinpisa.blogspot.com/


More information about the Zope mailing list