Ejemplo n.º 1
0
 def setUp(self):
     os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join(
         self.BASE_DIR, "config-tests-metrics.yml")
     ms = MyMicroservice(path=__file__)
     ms.reload_conf()
     self.app = ms.create_app()
     self.client = self.app.test_client()
Ejemplo n.º 2
0
 def setUp(self):
     os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                                           "config-tests-flask.yml")
     ms = MyMicroservice(path=__file__)
     ms.reload_conf()
     self.app = ms.create_app()
     self.client = self.app.test_client()
     self.assertEqual("Python Microservice With Flask", self.app.config["APP_NAME"])
Ejemplo n.º 3
0
def test_configfiles(payload, configfile, status_code):
    os.environ[CONFIGMAP_FILE_ENVIRONMENT] = os.path.join(
        os.path.dirname(os.path.abspath(__file__)), configfile)
    ms = MyMicroservice(path=__file__)
    ms.reload_conf()
    app = ms.create_app()
    client = app.test_client()
    response = client.get("/")
    assert payload == app.config["APP_NAME"]
    assert status_code == response.status_code