@@ -125,6 +125,7 @@ def test_create_and_delete_group(self, caplog: pytest.LogCaptureFixture) -> None
125125 IMPORTANT - This test method and the parameters used depend on target system!
126126 the hard coded sample exists on ELKW1610.KRZ.TOOLS.
127127
128+ 0. delete any group which contains sample group name to have clean system setup
128129 1. with minimal parameters.
129130 2. More complex group information
130131 3. Checks if a group can not be created with name of an existing group
@@ -134,9 +135,15 @@ def test_create_and_delete_group(self, caplog: pytest.LogCaptureFixture) -> None
134135 SAMPLE_NEW_GROUP_TYPE = 2
135136 SAMPLE_GROUP_STATUS_ID = 1
136137 SAMPLE_CAMPUS_ID = 0
138+ SAMPLE_GROUP_NAME = "TestGroup"
139+ SAMPLE_GROUP_NAME2 = "TestGroup With Campus And Superior"
140+
141+ # 0. cleanup delete existing groups which contain name sample_group_name
142+ existing_groups = self .api .get_groups (query = SAMPLE_GROUP_NAME )
143+ for group in existing_groups :
144+ self .api .delete_group (group_id = group ["id" ])
137145
138146 # 1. minimal group
139- SAMPLE_GROUP_NAME = "TestGroup"
140147
141148 group1 = self .api .create_group (
142149 SAMPLE_GROUP_NAME ,
@@ -149,7 +156,6 @@ def test_create_and_delete_group(self, caplog: pytest.LogCaptureFixture) -> None
149156 assert group1 ["information" ]["groupStatusId" ] == SAMPLE_GROUP_STATUS_ID
150157
151158 # 2. more complex group
152- SAMPLE_GROUP_NAME2 = "TestGroup With Campus And Superior"
153159 group2 = self .api .create_group (
154160 SAMPLE_GROUP_NAME2 ,
155161 group_status_id = SAMPLE_GROUP_STATUS_ID ,
0 commit comments