Add tests to verify correctness of the switching provider task

This commit is contained in:
Imdad Ahad
2017-02-13 15:46:06 +00:00
parent d058626119
commit 73d5ce4f8b
5 changed files with 232 additions and 40 deletions

View File

@@ -113,3 +113,17 @@ def set_config(app, name, value):
app.config[name] = value
yield
app.config[name] = old_val
@contextmanager
def set_config_values(app, dict):
old_values = {}
for key in dict:
old_values[key] = app.config.get(key)
app.config[key] = dict[key]
yield
for key in dict:
app.config[key] = old_values[key]