Ticket #5193: bug5193-3.patch

File bug5193-3.patch, 2.6 KB (added by dustin, 3 years ago)

bug5193-3.patch

  • twisted/persisted/styles.py

    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 def _aybabtu(c): 
    154154    L{twisted.python.reflect.allYourBase} function. 
    155155 
    156156    @param c: a class 
    157     @returns: list of classes 
     157    @returns: list of classes, in unspecified order 
    158158    """ 
    159159    # begin with two classes that should *not* be included in the 
    160160    # final result 
  • twisted/test/test_persisted.py

    diff --git a/twisted/test/test_persisted.py b/twisted/test/test_persisted.py
    index 7aeb970..01b7722 100644
    a b class AybabtuTests(unittest.TestCase): 
    142142    """ 
    143143 
    144144    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        """ 
    146148        self.assertEqual(styles._aybabtu(styles.Versioned), []) 
    147149 
    148150 
    149151    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        """ 
    152156        self.assertEqual(styles._aybabtu(VersionedSubClass), []) 
    153157 
    154158 
    155159    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        """ 
    158164        self.assertEqual(styles._aybabtu(VersionedSubSubClass), 
    159165            [VersionedSubClass]) 
    160166 
    161167 
    162168    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])) 
    167176 
    168177 
    169178