mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 18:52:50 -05:00
Add tests to verify correctness of the switching provider task
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user