示例#1
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())))
示例#2
0
def userMethods():
    if request.method == 'GET':
        response='list user methods'
        apiFace = Face(appStats,'/userMethods/',request.method,'list Fibonacci libraries available')
        return apiFace.response(appStats,'Pass',apiFace.dictionaryToJson(libs.list()))
    elif request.method == 'PUT':
        response='update user method'
        apiFace = Face(appStats,'/userMethods/',request.method,'update Fibonacci libraries available')
    elif request.method == 'POST':
        response='create user method'
        apiFace = Face(appStats,'/userMethods/',request.method,'create Fibonacci libraries available')
        #libs.add('TableFib','limited recursion with simple storage')
    elif request.method == 'DELETE':
        response='drop user method'
        apiFace = Face(appStats,'/userMethods/',request.method,'drop Fibonacci libraries available')

    return apiFace.response(appStats,'Fail','not supported:'+response)
示例#3
0
def status():
    apiFace = Face(appStats,'/status/',request.method,"health check")
    print url_for('status')
    #return status and result
    return apiFace.response(appStats,'healthy',apiFace.dictionaryToJson(appStats.getStats()))