def setUp(self): os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join(self.BASE_DIR, "config-tests-swagger_3_no_abs_path.yml") ms = MyMicroserviceNoSingleton(path=__file__) ms.reload_conf() self.app = ms.create_app() self.client = self.app.test_client() self.assertEqual("Python Microservice Swagger Openapi 3 No abspath", self.app.config["APP_NAME"])
def setUp(self): os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join( self.BASE_DIR, "config-tests-metrics.yml") ms = MyMicroserviceNoSingleton(path=__file__) ms.reload_conf() self.app = ms.create_app() self.client = self.app.test_client()
def setUp(self): os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join( self.BASE_DIR, "config-tests-swagger.yml") ms = MyMicroserviceNoSingleton(service="my-ms", path=__file__) self.app = ms.create_app() self.client = self.app.test_client() self.assertEqual("Python Microservice Swagger", self.app.config["APP_NAME"])
def setUp(self): os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join( os.path.dirname(os.path.abspath(__file__)), "config-tests-flask-encrypted-none.yml" ) ms = MyMicroserviceNoSingleton(path=__file__) ms.reload_conf() self.app = ms.create_app() self.client = self.app.test_client() self.assertEqual("Python Microservice With Flask encrypted None", self.app.config["APP_NAME"])
def setUp(self): TestMultiprocessMetricsFlask.current = self._testMethodName os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join( self.BASE_DIR, "config-tests-metrics.yml") ms = MyMicroserviceNoSingleton(path=__file__) ms.reload_conf() reset_metrics() self.app = ms.create_app() self.client = self.app.test_client() for path in Path(self.temp_dir.name).iterdir(): if self._testMethodName not in path.name: path.unlink()
def setUp(self): os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join( os.path.dirname(os.path.abspath(__file__)), "config-tests-flask-encrypted-fernet.yml" ) os.environ[CRYPT_FILE_KEY_ENVIRONMENT] = os.path.join(self.BASE_DIR, "key.key") self.crypt = CryptFernet(path=self.BASE_DIR) self.crypt._loader.put_file(b"9IXx2F5d5Ob-h5xdCnFSUXhuFKLGRibvLfSbixpcfCw=", "wb") ms = MyMicroserviceNoSingleton(path=__file__) ms.reload_conf() self.app = ms.create_app() self.client = self.app.test_client() self.assertEqual("Python Microservice With Flask encrypted", self.app.config["APP_NAME"])