commit a9e6c4f40dee3e8b6e1f27344b9e5d426851ee67
Author: Dustin J. Mitchell <dustin@mozilla.com>
Date: Wed Aug 17 13:58:15 2011 -0500
_aybabtu: fix docstrings' refs to `set`, don't test order of results
diff --git a/twisted/persisted/styles.py b/twisted/persisted/styles.py
index 0744875..071daf3 100644
|
a
|
b
|
|
| 154 | 154 | L{twisted.python.reflect.allYourBase} function. |
| 155 | 155 | |
| 156 | 156 | @param c: a class |
| 157 | | @returns: list of classes |
| | 157 | @returns: list of classes, in unspecified order |
| 158 | 158 | """ |
| 159 | 159 | # begin with two classes that should *not* be included in the |
| 160 | 160 | # final result |
diff --git a/twisted/test/test_persisted.py b/twisted/test/test_persisted.py
index 7aeb970..01b7722 100644
|
a
|
b
|
|
| 142 | 142 | """ |
| 143 | 143 | |
| 144 | 144 | def test_aybabtu_strict_empty(self): |
| 145 | | """_aybabtu of L{Versioned} itself is an empty set""" |
| | 145 | """ |
| | 146 | _aybabtu of L{Versioned} itself is an empty list |
| | 147 | """ |
| 146 | 148 | self.assertEqual(styles._aybabtu(styles.Versioned), []) |
| 147 | 149 | |
| 148 | 150 | |
| 149 | 151 | def test_aybabtu_strict_subclass(self): |
| 150 | | """there are no classes I{between} L{VersionedSubClass} and |
| 151 | | L{Versioned}, so L{styles._aybabtu} returns an empty set""" |
| | 152 | """ |
| | 153 | there are no classes I{between} L{VersionedSubClass} and |
| | 154 | L{Versioned}, so L{styles._aybabtu} returns an empty list |
| | 155 | """ |
| 152 | 156 | self.assertEqual(styles._aybabtu(VersionedSubClass), []) |
| 153 | 157 | |
| 154 | 158 | |
| 155 | 159 | def test_aybabtu_subsubclass(self): |
| 156 | | """With a sub-sub-class of L{Versioned}, L{styles._aybabtu} returns the |
| 157 | | intervening subclass.""" |
| | 160 | """ |
| | 161 | With a sub-sub-class of L{Versioned}, L{styles._aybabtu} returns only |
| | 162 | the intervening subclass. |
| | 163 | """ |
| 158 | 164 | self.assertEqual(styles._aybabtu(VersionedSubSubClass), |
| 159 | 165 | [VersionedSubClass]) |
| 160 | 166 | |
| 161 | 167 | |
| 162 | 168 | def test_aybabtu_strict(self): |
| 163 | | """For a diamond-shaped inheritance graph, L{styles._aybabtu} returns |
| 164 | | I{both} intermediate subclasses.""" |
| 165 | | self.assertEqual(styles._aybabtu(VersionedDiamondSubClass), |
| 166 | | [VersionedSubSubClass, VersionedSubClass, SecondVersionedSubClass]) |
| | 169 | """ |
| | 170 | For a diamond-shaped inheritance graph, L{styles._aybabtu} returns |
| | 171 | I{both} intermediate subclasses, although order is unspecified. |
| | 172 | """ |
| | 173 | self.assertEqual(sorted(styles._aybabtu(VersionedDiamondSubClass)), |
| | 174 | sorted([VersionedSubSubClass, VersionedSubClass, |
| | 175 | SecondVersionedSubClass])) |
| 167 | 176 | |
| 168 | 177 | |
| 169 | 178 | |