Skip to content

Commit 6a502ba

Browse files
committed
ISSUE-1836: Allow dashboard tests on cloud
1 parent 9370b18 commit 6a502ba

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/resources/test_dashboard.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77

88
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
1010

1111

1212
class DashboardTests(JiraTestCase):
@@ -57,6 +57,7 @@ def test_dashboard(self):
5757
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
5858
reason="Functionality only available on Jira Cloud",
5959
)
60+
@allow_on_cloud
6061
def test_create_dashboard(self):
6162
name = rndstr()
6263
description = rndstr()
@@ -81,6 +82,7 @@ def test_create_dashboard(self):
8182
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
8283
reason="Functionality only available on Jira Cloud",
8384
)
85+
@allow_on_cloud
8486
def test_delete_dashboard(self):
8587
dashboard = self.jira.create_dashboard(name="to_delete")
8688
dashboard_id = dashboard.id
@@ -99,6 +101,7 @@ def test_delete_dashboard(self):
99101
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
100102
reason="Functionality only available on Jira Cloud",
101103
)
104+
@allow_on_cloud
102105
def test_copy_dashboard(self):
103106
original_dashboard = self.jira.create_dashboard(
104107
name=rndstr(), share_permissions=[{"type": "authenticated"}]
@@ -133,6 +136,7 @@ def test_copy_dashboard(self):
133136
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
134137
reason="Functionality only available on Jira Cloud",
135138
)
139+
@allow_on_cloud
136140
def test_gadgets(self):
137141
# NOTE(jpalmer): This is a super basic test. We can't really rely on the fact
138142
# that the gadgets available at any given moment will be specifically represented
@@ -145,6 +149,7 @@ def test_gadgets(self):
145149
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
146150
reason="Functionality only available on Jira Cloud",
147151
)
152+
@allow_on_cloud
148153
def test_dashboard_gadgets(self):
149154
gadget_count = 3
150155
dashboard = self.jira.create_dashboard(
@@ -171,6 +176,7 @@ def test_dashboard_gadgets(self):
171176
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
172177
reason="Functionality only available on Jira Cloud",
173178
)
179+
@allow_on_cloud
174180
def test_update_dashboard_automatic_refresh_seconds(self):
175181
dashboard = self.jira.create_dashboard(
176182
name=rndstr(), share_permissions=[{"type": "authenticated"}]
@@ -187,6 +193,7 @@ def test_update_dashboard_automatic_refresh_seconds(self):
187193
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
188194
reason="Functionality only available on Jira Cloud",
189195
)
196+
@allow_on_cloud
190197
def test_add_gadget_to_dashboard(self):
191198
dashboard = self.jira.create_dashboard(
192199
name=rndstr(), share_permissions=[{"type": "authenticated"}]
@@ -211,6 +218,7 @@ def test_add_gadget_to_dashboard(self):
211218
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
212219
reason="Functionality only available on Jira Cloud",
213220
)
221+
@allow_on_cloud
214222
def test_remove_gadget_from_dashboard(self):
215223
dashboard = self.jira.create_dashboard(
216224
name=rndstr(), share_permissions=[{"type": "authenticated"}]
@@ -240,6 +248,7 @@ def test_remove_gadget_from_dashboard(self):
240248
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
241249
reason="Functionality only available on Jira Cloud",
242250
)
251+
@allow_on_cloud
243252
def test_dashboard_item_property_keys(self):
244253
dashboard = self.jira.create_dashboard(
245254
name=rndstr(), share_permissions=[{"type": "authenticated"}]
@@ -295,6 +304,7 @@ def test_dashboard_item_property_keys(self):
295304
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
296305
reason="Functionality only available on Jira Cloud",
297306
)
307+
@allow_on_cloud
298308
def test_dashboard_item_properties(self):
299309
dashboard = self.jira.create_dashboard(
300310
name=rndstr(), share_permissions=[{"type": "authenticated"}]
@@ -348,6 +358,7 @@ def test_dashboard_item_properties(self):
348358
os.environ.get("CI_JIRA_TYPE", "Server").upper() != "CLOUD",
349359
reason="Functionality only available on Jira Cloud",
350360
)
361+
@allow_on_cloud
351362
@mock.patch("requests.Session.request")
352363
def test_set_dashboard_item_property_not_201_response(self, mocked_request):
353364
mocked_request.return_value = mock.MagicMock(status_code=404)

0 commit comments

Comments
 (0)