def test_existence(self) -> None: """tests the function that gets app config """ appConfig = initAppConfig() self.assertFalse(appConfig == None) self.assertTrue("persons" in appConfig) self.assertTrue("hrsOffset" in appConfig)
def test_run(self) -> None: """tests the function that sends email """ appConfig = initAppConfig() # print(appConfig) fPath = appConfig["dataFilePath"] df1 = pd.DataFrame([['a', 'b'], ['c', 'd']], index=['row 1', 'row 2'], columns=['col 1', 'col 2']) df1.to_excel(fPath) self.assertTrue(1 == 1)
def test_run(self) -> None: """tests the function that sends email """ appConfig = initAppConfig() # print(appConfig) emailConfig = appConfig["emailConfig"] emailApi = EmailSender(emailConfig['emailAddress'], emailConfig["username"], emailConfig["password"], emailConfig['host']) emailApi.sendEmail(['*****@*****.**'], "Testing email sender in python", 'Hello from python script!', "data.xlsx") self.assertTrue(1 == 1)
def setUp(self): self.appConf = initAppConfig()
def test_run(self) -> None: """tests the function that gets the reason Id """ appConf = initAppConfig() reasId = getReasonId(appConf["pwcDbConnStr"], "VR", 4) self.assertFalse(reasId == -1)
from src.routeControllers.codeTags import codeTagsPage from src.routeControllers.elements import elementsPage from src.routeControllers.outages import outagesPage from src.routeControllers.realTimeOutage import realTimeOutagePage from src.security.errorHandlers import page_forbidden, page_not_found, page_unauthorized from flask import Flask, request, jsonify, render_template from waitress import serve from werkzeug.middleware.dispatcher import DispatcherMiddleware from werkzeug.exceptions import NotFound from typing import Any, cast import os import pandas as pd from src.appConfig import getConfig, initAppConfig from src.app.utils.defaultJsonEncoder import ServerJSONEncoder # get application config appConfig = initAppConfig() initOauthClient() # set this variable since we are currently not running this app on SSL os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' app = Flask(__name__) app.json_encoder = ServerJSONEncoder appPrefix = appConfig["appPrefix"] if pd.isna(appPrefix): appPrefix = "" # Set the secret key to some random bytes app.secret_key = appConfig['flaskSecret']
def test_personsConfig(self) -> None: """tests the function that gets persons details from app config """ appConfig = initAppConfig() persons = appConfig["persons"] self.assertTrue(isinstance(persons, list))
def test_run(self) -> None: """tests the function that gets the application config """ appConf = initAppConfig() self.assertTrue("pwcDbConnStr" in appConf) self.assertTrue("appDbConnStr" in appConf)