Skip to content

Commit 13ae342

Browse files
authored
Alias get_organizations (#1134)
* alias get_organizations Add `service_desk.get_organizations()` as an alias of `get_organisations()`. * add tests for `get_organizations`
1 parent 2a7c2db commit 13ae342

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

atlassian/service_desk.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ def get_organisations(self, service_desk_id=None, start=0, limit=50):
324324
)
325325
return self.get(url_with_sd_id, headers=self.experimental_headers, params=params)
326326

327+
# add alias for spelling consistency
328+
get_organizations = get_organisations
329+
327330
def get_organization(self, organization_id):
328331
"""
329332
Get an organization for a given organization ID

tests/test_servicedesk.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# coding: utf8
2-
import pytest
32
import sys
43

4+
import pytest
5+
56
from atlassian import ServiceDesk
67

78
SERVICEDESK = None
@@ -25,6 +26,10 @@ def test_get_organisations(self):
2526
result = [x["name"] for x in SERVICEDESK.get_organisations()["values"]]
2627
assert result == ["Charlie Cakes Franchises"], "Result of [get_organisations()]"
2728

29+
def test_get_organizations(self):
30+
result = [x["name"] for x in SERVICEDESK.get_organizations()["values"]]
31+
assert result == ["Charlie Cakes Franchises"], "Result of [get_organizations()]"
32+
2833
def test_get_organisations_servicedesk_id(self):
2934
result = [x["name"] for x in SERVICEDESK.get_organisations(service_desk_id="{serviceDeskId}")["values"]]
3035
assert result == [
@@ -33,6 +38,14 @@ def test_get_organisations_servicedesk_id(self):
3338
"The Adjustment Bureau",
3439
], "Result of [get_organisations(service_desk_id)]"
3540

41+
def test_get_organizations_servicedesk_id(self):
42+
result = [x["name"] for x in SERVICEDESK.get_organizations(service_desk_id="{serviceDeskId}")["values"]]
43+
assert result == [
44+
"Charlie Cakes Franchises",
45+
"Atlas Coffee Co",
46+
"The Adjustment Bureau",
47+
], "Result of [get_organizations(service_desk_id)]"
48+
3649
def test_get_organization(self):
3750
result = SERVICEDESK.get_organization("{organizationId}")
3851
assert result["name"] == "Charlie Cakes Franchises", "Result of [test_get_organization(...)]"

0 commit comments

Comments
 (0)