Changeset 8369


Ignore:
Timestamp:
6 May 2012, 13:17:01 (13 years ago)
Author:
uli
Message:

iface_names helper does not work correctly when it comes to deeper
nested interface inheritance. Show this in tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py

    r8192 r8369  
    252252        class I2(I1):
    253253            baz = schema.TextLine(title=u'some baz')
    254 
    255         result1 = helpers.iface_names(I2)
    256         result2 = helpers.iface_names(I1)
    257         result3 = helpers.iface_names(I2, exclude_attribs=False)
    258         result4 = helpers.iface_names(I2, exclude_methods=False)
    259         result5 = helpers.iface_names(I2, omit='i1_name')
     254        class I3(I2):
     255            pass
     256
     257        result1 = helpers.iface_names(I3)
     258        result2 = helpers.iface_names(I2)
     259        result3 = helpers.iface_names(I1)
     260        result4 = helpers.iface_names(I3, exclude_attribs=False)
     261        result5 = helpers.iface_names(I3, exclude_methods=False)
     262        result6 = helpers.iface_names(I3, omit='i1_name')
    260263        self.assertEqual(sorted(result1), ['baz', 'i1_name'])
    261         self.assertEqual(sorted(result2), ['i1_name'])
    262         self.assertEqual(sorted(result3), ['baz', 'foo', 'i1_name'])
    263         self.assertEqual(sorted(result4), ['bar', 'baz', 'i1_name'])
    264         self.assertEqual(sorted(result5), ['baz'])
     264        self.assertEqual(sorted(result2), ['baz', 'i1_name'])
     265        self.assertEqual(sorted(result3), ['i1_name'])
     266        self.assertEqual(sorted(result4), ['baz', 'foo', 'i1_name'])
     267        self.assertEqual(sorted(result5), ['bar', 'baz', 'i1_name'])
     268        self.assertEqual(sorted(result6), ['baz'])
    265269        return
    266270
Note: See TracChangeset for help on using the changeset viewer.