I'd like to point everyone at the CPSUtil.testing.genericsetup module. It's there to provide helpers for all GenericSetup related testing.

It was created a while back by Anahide when she corrected a bug in the Trees Tool I/O, but it hasn't been widely used yet. The goal is to provide a set of test case base classes to ease all testing related to GenericSetup that has to be done in a CPS Context.

At the full profile level, we have ExportImportTestCase. You can use it to make an assertion on a given configuration (e.g., check some consistency) and track bugs in the import process. More specifically, it's able to register a profile, import it, export it and check things in the produced tarball. This is a ZopeTestCase. You can use it to import the profile you want to test as well as one upon which your module relies. Anahide, please correct me if I missed something.

At the adapter level, we have TestXMLAdapter. This base class can be used for instance in CPSZCMLLayer. The daughter class has to implement buildObject (the object to be adapted) and can use importString to launch importation. See CPSSchemas.tests.test_exportimport for an example. There's no export helper yet, since I didn't need it.

If those base classes lack features you need, this is the right place to implement them, or request them to be implemented.

---------
Georges Racinet                        Nuxeo SAS
[EMAIL PROTECTED]                http://nuxeo.com
Tel: +33 (0) 1 40 33 71 73


_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel

Reply via email to