

def testExpansionSignalFrequency(self):
    d = {
        
    }
    for i in range(0, 10):
        dd = {
            
        }
        for j in range(0, 10):
            dd[str(j)] = j
        d[str(i)] = dd
    p = Gaffer.DictPath(d, '/')
    w = GafferUI.PathListingWidget(p)
    c = GafferTest.CapturingSlot(w.expansionChangedSignal())
    self.assertEqual(len(c), 0)
    w.setPathExpanded(Gaffer.DictPath(d, '/1'), True)
    self.assertEqual(len(c), 1)
    w.setPathExpanded(Gaffer.DictPath(d, '/1'), True)
    self.assertEqual(len(c), 1)
    w.setPathExpanded(Gaffer.DictPath(d, '/2'), True)
    self.assertEqual(len(c), 2)
    e = w.getExpandedPaths()
    self.assertEqual(len(e), 2)
    w.setExpandedPaths([])
    self.assertEqual(len(c), 3)
    w.setExpandedPaths(e)
    self.assertEqual(len(c), 4)

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUITest/PathListingWidgetTest.py PathListingWidgetTest.testExpansionSignalFrequency/original