

def testExpandedPaths(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)
    self.assertEqual(len(w.getExpandedPaths()), 0)
    p1 = Gaffer.DictPath(d, '/1')
    self.assertEqual(w.getPathExpanded(p1), False)
    w.setPathExpanded(p1, True)
    self.assertEqual(w.getPathExpanded(p1), True)
    self.assertEqual(len(w.getExpandedPaths()), 1)
    self.assertEqual(str(list(p1.getExpandedPaths())[0]), str(p1))
    w.setPathExpanded(p1, False)
    self.assertEqual(w.getPathExpanded(p1), False)
    self.assertEqual(len(w.getExpandedPaths()), 0)
    p2 = Gaffer.DictPath(d, '/2')
    p3 = Gaffer.DictPath(d, '/3')
    w.setExpandedPaths([p1, p2])
    self.assertEqual(w.getPathExpanded(p1), True)
    self.assertEqual(w.getPathExpanded(p2), True)
    self.assertEqual(w.getPathExpanded(p3), False)
    self.assertEqual(w.getExpandedPaths(), [p1, p2])
    w.setPath(Gaffer.DictPath({
        
    }, '/'))
    self.assertEqual(len(w.getExpandedPaths()), 0)

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUITest/PathListingWidgetTest.py PathListingWidgetTest.testExpandedPaths/VarMisuse@178/214 `w`->`p1`