def test_split(self):
        """Test splitting into subgraphs.
        """
        foo = Foo()
        bar = Bar()

        idfoo = id(foo)
        idbar = id(bar)
        idfd = id(foo.__dict__)
        idbd = id(bar.__dict__)

        foo.next = bar
        bar.prev = foo

        l = []
        l.append(l)
        idl = id(l)

        del foo
        del bar
        del l

        gb = GarbageGraph()
        subs = gb.split_and_sort()
        self.assertEqual(len(subs), 2)

        self.assertEqual(subs[0].count, 4)
        self.assertEqual(subs[1].count, 1)
        fbg, lig = subs

        self.assert_(isinstance(fbg, GarbageGraph))
        self.assert_(isinstance(lig, GarbageGraph))

        self.assertEqual(len(fbg.edges), 4, fbg.edges)
        self.assertEqual(len(lig.edges), 1, lig.edges)

        self.assert_(lig.edges in _Edge(idl, idl, ''), lig.edges)

        self.assert_(_Edge(idfoo, idfd, '__dict__') in fbg.edges, fbg.edges)
        self.assert_(_Edge(idfd, idbar, 'next') in fbg.edges, fbg.edges)
        self.assert_(_Edge(idbar, idbd, '__dict__') in fbg.edges, fbg.edges)
        self.assert_(_Edge(idbd, idfoo, 'prev') in fbg.edges, fbg.edges)
dataset/ETHPy150Open pympler/pympler/test/gui/test_garbage.py/GarbageTestCase.test_split/swapped operands of `in`