Skip to content

Alias get_organizations #1134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions atlassian/service_desk.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ def get_organisations(self, service_desk_id=None, start=0, limit=50):
)
return self.get(url_with_sd_id, headers=self.experimental_headers, params=params)

# add alias for spelling consistency
get_organizations = get_organisations

def get_organization(self, organization_id):
"""
Get an organization for a given organization ID
Expand Down
15 changes: 14 additions & 1 deletion tests/test_servicedesk.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# coding: utf8
import pytest
import sys

import pytest

from atlassian import ServiceDesk

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

def test_get_organizations(self):
result = [x["name"] for x in SERVICEDESK.get_organizations()["values"]]
assert result == ["Charlie Cakes Franchises"], "Result of [get_organizations()]"

def test_get_organisations_servicedesk_id(self):
result = [x["name"] for x in SERVICEDESK.get_organisations(service_desk_id="{serviceDeskId}")["values"]]
assert result == [
Expand All @@ -33,6 +38,14 @@ def test_get_organisations_servicedesk_id(self):
"The Adjustment Bureau",
], "Result of [get_organisations(service_desk_id)]"

def test_get_organizations_servicedesk_id(self):
result = [x["name"] for x in SERVICEDESK.get_organizations(service_desk_id="{serviceDeskId}")["values"]]
assert result == [
"Charlie Cakes Franchises",
"Atlas Coffee Co",
"The Adjustment Bureau",
], "Result of [get_organizations(service_desk_id)]"

def test_get_organization(self):
result = SERVICEDESK.get_organization("{organizationId}")
assert result["name"] == "Charlie Cakes Franchises", "Result of [test_get_organization(...)]"
Expand Down