Beispiel #1
0
log("OKAY", "Imported: lib.ehook")
import requests

log("OKAY", "Imported: requests")
import filecmp

log("OKAY", "Imported: filecmp")
from lib.testFramework import testFramework

log("OKAY", "Imported: lib.testFramework.testFramework")

# Start a new session
sess = requests.Session()
sauce = ""
logParserTest = testFramework("logParser")


# Server Online Test
def __testServerOnline():
    global sess

    try:
        sess.get("http://localhost")
    except Exception as excp:
        return repr(excp)

    return True


logParserTest.case("Server should be up and running", __testServerOnline)
Beispiel #2
0
from lib.log import log
log("OKAY", "Imported: lib.log.log")
import lib.ehook
log("OKAY", "Imported: lib.ehook")
import requests
log("OKAY", "Imported: requests")
import filecmp
log("OKAY", "Imported: filecmp")
from lib.testFramework import testFramework
log("OKAY", "Imported: lib.testFramework.testFramework")

# Start a new session
sess = requests.Session()
sauce = ""
apiTest = testFramework("API")

# Server Online Test
def __testServerOnline():
    global sess

    try:
        sess.get("http://localhost")
    except Exception as excp:
        return excp.__class__.__name__

    return True

apiTest.case("Server should be up and running", __testServerOnline)

def testAPI(url = "", method = "GET", json = True, data = {}, files = {}):