SVN: zope.testing/branches/gotcha-test-layers/src/zope/testing/testrunner/layerutils.py more tests
Godefroid Chapelle <[email protected]> Thu, 17 Mar 2011 08:57:36 -0400 (EDT)
| Newsgroups | gmane.comp.web.zope.zope3.cvs |
|---|---|
| Message-ID | <20110317125736.A63CE7083BC__35046.6582029641$1300366667$gmane$org@cvs.zope.org> |
Log message for revision 121000:
more tests
Changed:
U zope.testing/branches/gotcha-test-layers/src/zope/testing/testrunner/layerutils.py
-=-
Modified: zope.testing/branches/gotcha-test-layers/src/zope/testing/testrunner/layerutils.py
===================================================================
--- zope.testing/branches/gotcha-test-layers/src/zope/testing/testrunner/layerutils.py 2011-03-17 12:53:02 UTC (rev 120999)
+++ zope.testing/branches/gotcha-test-layers/src/zope/testing/testrunner/layerutils.py 2011-03-17 12:57:36 UTC (rev 121000)
@@ -144,6 +144,8 @@
>>> order_by_bases([one, both_one, other_one, both_one_bis])
[one, other_one, both_one, both_one_bis]
+ Let's use a layer of specificity two:
+
>>> order_by_bases([two, both_one_bis, one, other_one, both_one])
[one, other_one, both_one, both_one_bis, two]
>>> order_by_bases([one, two, both_one_bis, other_one, both_one])
@@ -153,6 +155,19 @@
>>> order_by_bases([one, both_one, two, other_one, both_one_bis])
[one, other_one, both_one, both_one_bis, two]
+ Another layer of specificity two:
+
+ >>> other_two = TestLayer(bases=(other_one, ), name='other_two')
+
+ >>> order_by_bases([other_two, two, both_one_bis, one, other_one, both_one])
+ [one, other_one, both_one, both_one_bis, other_two, two]
+ >>> order_by_bases([one, other_two, two, both_one_bis, other_one, both_one])
+ [one, other_one, both_one, both_one_bis, other_two, two]
+ >>> order_by_bases([one, both_one, other_two, two, other_one, both_one_bis])
+ [one, other_one, both_one, both_one_bis, other_two, two]
+ >>> order_by_bases([both_one, one, two, other_two, both_one_bis, other_one])
+ [one, other_one, both_one, both_one_bis, other_two, two]
+
"""
named_layers = [(name_from_layer(layer), layer) for layer in layers]
named_layers.sort()