def test_index_set_conversion(self):
        try:
            import AppKit
        except __HOLE__:
            from nose import SkipTest
            raise SkipTest

        from tinymail.ui_delegates import array_from_index_set
        data = [
            [],
            [0],
            [3],
            [0, 1, 2],
            [7, 8, 9, 22],
        ]

        for value in data:
            index_set = AppKit.NSMutableIndexSet.indexSet()
            for i in value:
                index_set.addIndex_(i)
            converted = array_from_index_set(index_set)
            self.assertEqual(value, converted)
dataset/ETHPy150Open mgax/tinymail/src/tinymail/tests/test_indexsets.py/IndexSetConversionTest.test_index_set_conversion