Skip to content

Commit d27273b

Browse files
committed
deleted set_result_for_command
1 parent 79ccf19 commit d27273b

File tree

1 file changed

+7
-66
lines changed

1 file changed

+7
-66
lines changed

src/xpk/commands/managed_ml_diagnostics_test.py

Lines changed: 7 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
limitations under the License.
1515
"""
1616

17-
from argparse import Namespace
1817
from dataclasses import dataclass
19-
from typing import Any
2018
from unittest.mock import MagicMock
2119
import pytest
2220
from xpk.commands.managed_ml_diagnostics import install_mldiagnostics_prerequisites
@@ -50,78 +48,21 @@ def mocks(mocker) -> _Mocks:
5048
commands_print_mock=commands_print_mock,
5149
commands_tester=CommandsTester(
5250
mocker,
53-
# run_command_with_updates_path=(
54-
# 'xpk.commands.managed_ml_diagnostics.run_command_with_updates'
55-
# ),
56-
# run_command_for_value_path=(
57-
# 'xpk.commands.managed_ml_diagnostics.run_command_for_value'
58-
# ),
51+
run_command_with_updates_path=(
52+
'xpk.commands.managed_ml_diagnostics.run_command_with_updates'
53+
),
54+
run_command_for_value_path=(
55+
'xpk.commands.managed_ml_diagnostics.run_command_for_value'
56+
),
5957
),
6058
)
6159

60+
6261
def test_install_mldiagnostics_prerequisites_commands_executed(
6362
mocks: _Mocks,
6463
mocker,
6564
):
6665

67-
mocks.commands_tester.set_result_for_command(
68-
(0, ''),
69-
'kubectl',
70-
'rollout',
71-
'status',
72-
'deployment/kueue-controller-manager',
73-
)
74-
75-
mocks.commands_tester.set_result_for_command(
76-
(0, ''),
77-
'kubectl',
78-
'rollout',
79-
'status',
80-
'deployment/cert-manager-webhook',
81-
)
82-
83-
mocks.commands_tester.set_result_for_command(
84-
(0, ''),
85-
'kubectl',
86-
'apply',
87-
'-f',
88-
'https://github.com/cert-manager/cert-manager/releases/',
89-
)
90-
91-
mocks.commands_tester.set_result_for_command(
92-
(0, ''),
93-
'gcloud',
94-
'artifacts',
95-
'generic',
96-
'download',
97-
)
98-
99-
mocks.commands_tester.set_result_for_command(
100-
(0, ''),
101-
'kubectl',
102-
'create',
103-
'namespace',
104-
'gke-mldiagnostics',
105-
)
106-
107-
mocks.commands_tester.set_result_for_command(
108-
(0, ''),
109-
'kubectl',
110-
'apply',
111-
'-f',
112-
'-n',
113-
'gke-mldiagnostics',
114-
)
115-
116-
mocks.commands_tester.set_result_for_command(
117-
(0, ''),
118-
'kubectl',
119-
'label',
120-
'namespace',
121-
'default',
122-
'managed-mldiagnostics-gke=true',
123-
)
124-
12566
install_mldiagnostics_prerequisites()
12667

12768
mocks.commands_tester.assert_command_run(

0 commit comments

Comments
 (0)