Module: check_mk
Branch: master
Commit: e3aa76ec9f433e4a1cf7a33f3fd5ff0c0c077943
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e3aa76ec9f433e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 11 13:17:50 2017 +0200
add group test: Only try to delete it after the test when it was created
Change-Id: I330926f3ffd9994c7d0e1da34e36fa22e3ebf3b5
---
tests/web/test_webapi.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/web/test_webapi.py b/tests/web/test_webapi.py
index ee78e66..9b5540d 100644
--- a/tests/web/test_webapi.py
+++ b/tests/web/test_webapi.py
@@ -178,7 +178,9 @@ def test_add_group(web, group_type):
if cmk.is_managed_edition():
assert provider == all_groups[group_id]["provider"]
finally:
- web.delete_group(group_type, group_id)
+ all_groups = web.get_all_groups(group_type)
+ if group_id in all_groups:
+ web.delete_group(group_type, group_id)
# TODO: Parameterize test for cme / non cme