Exemplo n.º 1
0
  def test_compare2(self):
    tests = FuncTest()
    stdLib = tests.getStandardDictionary()
    tests.runLibraryTests('LoopFib',stdLib)
    tstLib = tests.getTestDictionary()
    tests.runLibraryTests('GoldFib',tstLib)

    self.assertEqual(tests.testsPassed(),True)
Exemplo n.º 2
0
def test(fibMethod1,fibMethod2):
    apiFace = Face(appStats,'/test/'+fibMethod1+'/'+fibMethod2,request.method,'Compare library '+fibMethod2+' to '+fibMethod1)
    appTests = FuncTest()
    lib1 = appTests.getStandardDictionary()
    lib2 = appTests.getTestDictionary()
    appTests.runLibraryTests(fibMethod1,lib1)
    appTests.runLibraryTests(fibMethod2,lib2)
    testResults = appTests.compare()
    if appTests.testsPassed() == True: overall = "Pass"
    else: overall = "Fail"
    return apiFace.response(appStats,overall,apiFace.dictionaryToJson(sorted(testResults.iteritems())))