From 6591196af7f948adc7e5f593db90abea0742ea4b Mon Sep 17 00:00:00 2001 From: Logan Cary Date: Thu, 5 Sep 2024 10:37:37 -0400 Subject: [PATCH] address @mgrimesix --- tests/api2/test_mail.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/api2/test_mail.py b/tests/api2/test_mail.py index 82fde4c77fc18..c5e5af7e47c12 100644 --- a/tests/api2/test_mail.py +++ b/tests/api2/test_mail.py @@ -2,6 +2,7 @@ def test_config_settings(): + orig_config = call("mail.config") payload = { "fromemail": "william.spam@ixsystems.com", "outgoingserver": "mail.ixsystems.com", @@ -11,7 +12,11 @@ def test_config_settings(): "smtp": True, "user": "william.spam@ixsystems.com" } - call("mail.update", payload) - config = call("mail.config") - # test that payload is a subset of config - assert payload.items() <= config.items() + try: + call("mail.update", payload) + config = call("mail.config") + # test that payload is a subset of config + assert payload.items() <= config.items() + finally: + call("mail.update", {key: orig_config[key] for key in payload}) + assert call("mail.config") == orig_config