6
6
import pytest
7
7
8
8
from jira .exceptions import JIRAError
9
- from tests .conftest import JiraTestCase , broken_test , rndstr
9
+ from tests .conftest import JiraTestCase , allow_on_cloud , broken_test , rndstr
10
10
11
11
12
12
class DashboardTests (JiraTestCase ):
@@ -57,6 +57,7 @@ def test_dashboard(self):
57
57
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
58
58
reason = "Functionality only available on Jira Cloud" ,
59
59
)
60
+ @allow_on_cloud
60
61
def test_create_dashboard (self ):
61
62
name = rndstr ()
62
63
description = rndstr ()
@@ -81,6 +82,7 @@ def test_create_dashboard(self):
81
82
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
82
83
reason = "Functionality only available on Jira Cloud" ,
83
84
)
85
+ @allow_on_cloud
84
86
def test_delete_dashboard (self ):
85
87
dashboard = self .jira .create_dashboard (name = "to_delete" )
86
88
dashboard_id = dashboard .id
@@ -99,6 +101,7 @@ def test_delete_dashboard(self):
99
101
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
100
102
reason = "Functionality only available on Jira Cloud" ,
101
103
)
104
+ @allow_on_cloud
102
105
def test_copy_dashboard (self ):
103
106
original_dashboard = self .jira .create_dashboard (
104
107
name = rndstr (), share_permissions = [{"type" : "authenticated" }]
@@ -133,6 +136,7 @@ def test_copy_dashboard(self):
133
136
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
134
137
reason = "Functionality only available on Jira Cloud" ,
135
138
)
139
+ @allow_on_cloud
136
140
def test_gadgets (self ):
137
141
# NOTE(jpalmer): This is a super basic test. We can't really rely on the fact
138
142
# that the gadgets available at any given moment will be specifically represented
@@ -145,6 +149,7 @@ def test_gadgets(self):
145
149
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
146
150
reason = "Functionality only available on Jira Cloud" ,
147
151
)
152
+ @allow_on_cloud
148
153
def test_dashboard_gadgets (self ):
149
154
gadget_count = 3
150
155
dashboard = self .jira .create_dashboard (
@@ -171,6 +176,7 @@ def test_dashboard_gadgets(self):
171
176
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
172
177
reason = "Functionality only available on Jira Cloud" ,
173
178
)
179
+ @allow_on_cloud
174
180
def test_update_dashboard_automatic_refresh_seconds (self ):
175
181
dashboard = self .jira .create_dashboard (
176
182
name = rndstr (), share_permissions = [{"type" : "authenticated" }]
@@ -187,6 +193,7 @@ def test_update_dashboard_automatic_refresh_seconds(self):
187
193
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
188
194
reason = "Functionality only available on Jira Cloud" ,
189
195
)
196
+ @allow_on_cloud
190
197
def test_add_gadget_to_dashboard (self ):
191
198
dashboard = self .jira .create_dashboard (
192
199
name = rndstr (), share_permissions = [{"type" : "authenticated" }]
@@ -211,6 +218,7 @@ def test_add_gadget_to_dashboard(self):
211
218
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
212
219
reason = "Functionality only available on Jira Cloud" ,
213
220
)
221
+ @allow_on_cloud
214
222
def test_remove_gadget_from_dashboard (self ):
215
223
dashboard = self .jira .create_dashboard (
216
224
name = rndstr (), share_permissions = [{"type" : "authenticated" }]
@@ -240,6 +248,7 @@ def test_remove_gadget_from_dashboard(self):
240
248
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
241
249
reason = "Functionality only available on Jira Cloud" ,
242
250
)
251
+ @allow_on_cloud
243
252
def test_dashboard_item_property_keys (self ):
244
253
dashboard = self .jira .create_dashboard (
245
254
name = rndstr (), share_permissions = [{"type" : "authenticated" }]
@@ -295,6 +304,7 @@ def test_dashboard_item_property_keys(self):
295
304
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
296
305
reason = "Functionality only available on Jira Cloud" ,
297
306
)
307
+ @allow_on_cloud
298
308
def test_dashboard_item_properties (self ):
299
309
dashboard = self .jira .create_dashboard (
300
310
name = rndstr (), share_permissions = [{"type" : "authenticated" }]
@@ -348,6 +358,7 @@ def test_dashboard_item_properties(self):
348
358
os .environ .get ("CI_JIRA_TYPE" , "Server" ).upper () != "CLOUD" ,
349
359
reason = "Functionality only available on Jira Cloud" ,
350
360
)
361
+ @allow_on_cloud
351
362
@mock .patch ("requests.Session.request" )
352
363
def test_set_dashboard_item_property_not_201_response (self , mocked_request ):
353
364
mocked_request .return_value = mock .MagicMock (status_code = 404 )
0 commit comments