def testMakeDependencyMap(): global dependencyTestCases for aMap, expected, ignore, ignore in dependencyTestCases: result = prioritize.makeDependencyMap(aMap) checkResult = dict([(k, [x.item for x in result[k].children]) for k in result.keys()]) assert expected == checkResult, "expected:%s, got:%s" % (expected, checkResult)
def testBottomUpVisitor(): global dependencyTestCases for aMap,ignore,expected,ignore in dependencyTestCases: result = prioritize.makeDependencyMap(aMap) if {} == expected: assert {} == aMap for k in expected.keys(): v = prioritize.BottomUpVisitor() v.visit(result[k]) got = [x.item for x in v.history] assert expected[k]==got, "expected:%s, got:%s"%(expected[k],got)
def testMakeDependencyMap(): global dependencyTestCases for aMap,expected,ignore,ignore in dependencyTestCases: result = prioritize.makeDependencyMap(aMap) checkResult = dict([(k,[x.item for x in result[k].children]) for k in result.keys()]) assert expected == checkResult, "expected:%s, got:%s"%(expected,checkResult)