Example #1
0
def test_websiteEmptyStart(dbFilePath):
    try:
        if os.path.exists(dbFilePath):
            os.remove(dbFilePath)
    except Exception as e:
        pytest.skip(str(e))

    testUtils.startWebsite(callback_testResponse)
Example #2
0
def test_websiteEmptyStart():
    try:
        dbFilePath = os.path.join(testFolder, '../../data/db.sqlite3')
        if os.path.exists(dbFilePath):
            os.remove(dbFilePath)
    except Exception as e:
        pytest.skip(str(e))

    testUtils.startWebsite(callback_testResponse)
def test_ApiErrorNotLeaking():
    apiFilePath = os.path.join(testFolder, '../django/web/Api.py')
    backup = apiFilePath + ".bk"
    shutil.copyfile(apiFilePath, backup)

    try:
        with open(apiFilePath, 'r+') as file:
            data = file.read()
            data = re.sub(r"(^def\s.+:[\r\n][\r\n]?)",
                          r"\1\traise Exception()\n",
                          data,
                          flags=re.MULTILINE)
            file.seek(0)
            file.write(data)
            file.truncate()

        testUtils.startWebsite(callback_testApiErrorNotLeaking)
    finally:
        os.remove(apiFilePath)
        shutil.move(backup, apiFilePath)
def test_searchResultUpperBound():
	testUtils.startWebsite(callback_searchResultUpperBound)
def test_searchCategoryFilter():
	testUtils.startWebsite(callback_searchCategoryFilter)
def test_searchPermissionFilter():
	testUtils.startWebsite(callback_searchPermissionFilter)