Skip to content

Commit 8295d32

Browse files
Merge pull request #155 from code42/chore/pin-click
fix bugs found in QA, bump version, and pin click version
2 parents e95a3c6 + 8e73ee0 commit 8295d32

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
The intended audience of this file is for `incydr` SDK and CLI consumers -- as such, changes that don't affect
99
how a consumer would use the library or CLI tool (e.g. adding unit tests, updating documentation, etc) are not captured
1010
here.
11-
## Unreleased
11+
## 2.5.0 - 2025-06-06
1212

1313
### Added
1414

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies = [
3535
dynamic = ["version"]
3636

3737
[project.optional-dependencies]
38-
cli = ["click", "chardet"]
38+
cli = ["click==8.1.*", "chardet"]
3939

4040
[project.urls]
4141
Documentation = "https://github.com/code42/incydr_python#readme"

src/_incydr_sdk/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2022-present Code42 Software <[email protected]>
22
#
33
# SPDX-License-Identifier: MIT
4-
__version__ = "2.4.0"
4+
__version__ = "2.5.0"

src/_incydr_sdk/orgs/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ def create(
7575
pa
7676
**Returns**: An [`Org`][org-model] object representing the created org.
7777
"""
78+
# Ensure parent org guid
79+
if not parent_org_guid:
80+
orgslist = self.list().orgs
81+
id_list = list(map(lambda x: x.org_guid, orgslist))
82+
for org in orgslist:
83+
if org.parent_org_guid not in id_list:
84+
parent_org_guid = org.org_guid
85+
break
7886
payload = {
7987
"orgName": org_name,
8088
"orgExtRef": org_ext_ref,

tests/test_orgs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"orgName": TEST_ORG_NAME,
2626
"orgExtRef": None,
2727
"notes": None,
28-
"parentOrgGuid": None,
28+
"parentOrgGuid": TEST_DATA["orgGuid"],
2929
}
3030
TEST_UPDATE_ORG_PAYLOAD = {"orgName": TEST_ORG_NAME, "orgExtRef": None, "notes": None}
3131
TEST_ORG_LIST = {"totalCount": 1, "orgs": [TEST_DATA]}
@@ -41,6 +41,9 @@ def mock_get_org(httpserver_auth: HTTPServer):
4141

4242
@pytest.fixture
4343
def mock_create_org(httpserver_auth: HTTPServer):
44+
httpserver_auth.expect_request("/v1/orgs", method="GET").respond_with_json(
45+
response_json=TEST_ORG_LIST, status=200
46+
)
4447
httpserver_auth.expect_request(
4548
"/v1/orgs", method="POST", json=TEST_CREATE_ORG_PAYLOAD
4649
).respond_with_json(response_json=TEST_DATA, status=200)

0 commit comments

Comments
 (0)