Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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)