Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 3a7e9ec

Browse files
mangelajoNickCao
authored andcommitted
Fix MacOS test issues with /tmp and /private/tmp
(cherry picked from commit cf19abd)
1 parent 282c26d commit 3a7e9ec

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import uuid
2+
from pathlib import Path
23
from unittest.mock import AsyncMock, Mock, patch
34

45
import pytest
@@ -117,7 +118,7 @@ async def test_create_client(
117118
result = await runner.invoke(create, ["client", CLIENT_NAME, "--unsafe", "--out", out], input="\n\n")
118119
assert result.exit_code == 0
119120
assert "Client configuration successfully saved" in result.output
120-
mock_save_client.assert_called_once_with(UNSAFE_CLIENT_CONFIG, out)
121+
mock_save_client.assert_called_once_with(UNSAFE_CLIENT_CONFIG, str(Path(out).resolve()))
121122
mock_save_client.reset_mock()
122123

123124
# Regular client config is returned
@@ -260,7 +261,7 @@ async def test_create_exporter(
260261
result = await runner.invoke(create, ["exporter", EXPORTER_NAME, "--out", out])
261262
assert result.exit_code == 0
262263
assert "Exporter configuration successfully saved" in result.output
263-
save_exporter_mock.assert_called_once_with(EXPORTER_CONFIG, out)
264+
save_exporter_mock.assert_called_once_with(EXPORTER_CONFIG, str(Path(out).resolve()))
264265
save_exporter_mock.reset_mock()
265266

266267
# Save with nointeractive

packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def test_import_client(_load_kube_config_mock, get_client_config_mock: Asy
6565
result = await runner.invoke(import_res, ["client", CLIENT_NAME, "--unsafe", "--out", out])
6666
assert result.exit_code == 0
6767
assert "Client configuration successfully saved" in result.output
68-
save_client_config_mock.assert_called_once_with(UNSAFE_CLIENT_CONFIG, out)
68+
save_client_config_mock.assert_called_once_with(UNSAFE_CLIENT_CONFIG, str(Path(out).resolve()))
6969
save_client_config_mock.reset_mock()
7070

7171
# Save with path output
@@ -76,7 +76,7 @@ async def test_import_client(_load_kube_config_mock, get_client_config_mock: Asy
7676
)
7777
assert result.exit_code == 0
7878
assert result.output == f"{out}\n"
79-
save_client_config_mock.assert_called_once_with(UNSAFE_CLIENT_CONFIG, out)
79+
save_client_config_mock.assert_called_once_with(UNSAFE_CLIENT_CONFIG, str(Path(out).resolve()))
8080
save_client_config_mock.reset_mock()
8181

8282
# Create and save safe client config
@@ -129,15 +129,15 @@ async def test_import_exporter(_load_kube_config_mock, _get_exporter_config_mock
129129
result = await runner.invoke(import_res, ["exporter", EXPORTER_NAME, "--out", out])
130130
assert result.exit_code == 0
131131
assert "Exporter configuration successfully saved" in result.output
132-
save_exporter_config_mock.assert_called_with(EXPORTER_CONFIG, out)
132+
save_exporter_config_mock.assert_called_with(EXPORTER_CONFIG, str(Path(out).resolve()))
133133

134134
# Save with path output
135135
out = f"/tmp/{EXPORTER_NAME}.yaml"
136136
save_exporter_config_mock.return_value = Path(out)
137137
result = await runner.invoke(import_res, ["exporter", EXPORTER_NAME, "--out", out, "--output", "path"])
138138
assert result.exit_code == 0
139139
assert result.output == f"{out}\n"
140-
save_exporter_config_mock.assert_called_with(EXPORTER_CONFIG, out)
140+
save_exporter_config_mock.assert_called_with(EXPORTER_CONFIG, str(Path(out).resolve()))
141141

142142

143143
@pytest.fixture

0 commit comments

Comments
 (0)