Skip to content

Commit 28e9646

Browse files
committed
Fix tests
1 parent aeaebb0 commit 28e9646

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

cli/tests/test_client/test_organization_client.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,24 +331,30 @@ def test_skip_runs(self, mock_skip):
331331
@mock.patch("polyaxon._sdk.api.OrganizationsV1Api.tag_organization_runs")
332332
def test_tag_runs(self, mock_tag):
333333
"""Test batch tagging runs"""
334-
data = {"uuids": [self.uuid1, self.uuid2], "tags": ["production", "validated"]}
334+
uuids = [self.uuid1, self.uuid2]
335+
tags = ["production", "validated"]
335336

336337
client = OrganizationClient(owner=self.owner)
337-
client.tag_runs(data)
338+
client.tag_runs(uuids, tags)
338339

339340
assert mock_tag.call_count == 1
340-
mock_tag.assert_called_with(self.owner, body=data)
341+
call_args = mock_tag.call_args
342+
assert call_args[1]["body"].uuids == uuids
343+
assert call_args[1]["body"].tags == tags
341344

342345
@mock.patch("polyaxon._sdk.api.OrganizationsV1Api.transfer_organization_runs")
343346
def test_transfer_runs(self, mock_transfer):
344347
"""Test transferring runs to different project"""
345-
data = {"uuids": [self.uuid1, self.uuid2], "project": "destination-project"}
348+
uuids = [self.uuid1, self.uuid2]
349+
to_project = "destination-project"
346350

347351
client = OrganizationClient(owner=self.owner)
348-
client.transfer_runs(data)
352+
client.transfer_runs(uuids, to_project)
349353

350354
assert mock_transfer.call_count == 1
351-
mock_transfer.assert_called_with(self.owner, body=data)
355+
call_args = mock_transfer.call_args
356+
assert call_args[1]["body"].uuids == uuids
357+
assert call_args[1]["body"].project == to_project
352358

353359
# Version Management Tests
354360
def test_validate_kind(self):

cli/tests/test_client/test_project_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,16 @@ def test_bookmark_runs(self, mock_bookmark):
258258
@mock.patch("polyaxon._sdk.api.RunsV1Api.tag_runs")
259259
def test_tag_runs(self, mock_tag):
260260
"""Test batch tagging runs"""
261-
data = {"uuids": [self.uuid1, self.uuid2], "tags": ["production", "validated"]}
261+
uuids = [self.uuid1, self.uuid2]
262+
tags = ["production", "validated"]
262263

263264
client = ProjectClient(owner=self.owner, project=self.project)
264-
client.tag_runs(data)
265+
client.tag_runs(uuids, tags)
265266

266267
assert mock_tag.call_count == 1
267-
mock_tag.assert_called_with(self.owner, self.project, body=data)
268+
call_args = mock_tag.call_args
269+
assert call_args[1]["body"].uuids == uuids
270+
assert call_args[1]["body"].tags == tags
268271

269272
# Version Management Tests - Validation
270273
def test_validate_kind(self):

cli/tests/test_deploy/test_email.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_email_config(self):
1717
EmailConfig.from_dict(config_dict)
1818

1919
config_dict = {
20-
"emailFrom host": "dsf",
20+
"emailFromhost": "dsf",
2121
"port": "sdf",
2222
"useTls": True,
2323
"hostUser": "sdf",

0 commit comments

Comments
 (0)