Skip to content

Commit 8765eaa

Browse files
committed
cp dines
1 parent 7c73a86 commit 8765eaa

4 files changed

Lines changed: 40 additions & 40 deletions

File tree

tests/sdk/test_async_benchmark.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def test_list_runs_single(
8484
) -> None:
8585
"""Test list_runs method with single result."""
8686
page = SimpleNamespace(runs=[benchmark_run_view])
87-
mock_async_client.benchmarks.runs.list = AsyncMock(return_value=page)
87+
mock_async_client.benchmark_runs.list = AsyncMock(return_value=page)
8888

8989
benchmark = AsyncBenchmark(mock_async_client, "bmd_123")
9090
result = await benchmark.list_runs()
@@ -93,14 +93,14 @@ async def test_list_runs_single(
9393
assert isinstance(result[0], AsyncBenchmarkRun)
9494
assert result[0].id == benchmark_run_view.id
9595
assert result[0].benchmark_id == benchmark_run_view.benchmark_id
96-
mock_async_client.benchmarks.runs.list.assert_awaited_once_with(benchmark_id="bmd_123")
96+
mock_async_client.benchmark_runs.list.assert_awaited_once_with(benchmark_id="bmd_123")
9797

9898
async def test_list_runs_multiple(self, mock_async_client: AsyncMock) -> None:
9999
"""Test list_runs method with multiple results."""
100100
run_view1 = MockBenchmarkRunView(id="bmr_001")
101101
run_view2 = MockBenchmarkRunView(id="bmr_002")
102102
page = SimpleNamespace(runs=[run_view1, run_view2])
103-
mock_async_client.benchmarks.runs.list = AsyncMock(return_value=page)
103+
mock_async_client.benchmark_runs.list = AsyncMock(return_value=page)
104104

105105
benchmark = AsyncBenchmark(mock_async_client, "bmd_123")
106106
result = await benchmark.list_runs()
@@ -112,19 +112,19 @@ async def test_list_runs_multiple(self, mock_async_client: AsyncMock) -> None:
112112
assert result[0].benchmark_id == run_view1.benchmark_id
113113
assert result[1].id == run_view2.id
114114
assert result[1].benchmark_id == run_view2.benchmark_id
115-
mock_async_client.benchmarks.runs.list.assert_awaited_once_with(benchmark_id="bmd_123")
115+
mock_async_client.benchmark_runs.list.assert_awaited_once_with(benchmark_id="bmd_123")
116116

117117
async def test_list_runs_with_params(
118118
self, mock_async_client: AsyncMock, benchmark_run_view: MockBenchmarkRunView
119119
) -> None:
120120
"""Test list_runs method with filtering parameters."""
121121
page = SimpleNamespace(runs=[benchmark_run_view])
122-
mock_async_client.benchmarks.runs.list = AsyncMock(return_value=page)
122+
mock_async_client.benchmark_runs.list = AsyncMock(return_value=page)
123123

124124
benchmark = AsyncBenchmark(mock_async_client, "bmd_123")
125125
result = await benchmark.list_runs(limit=10, name="test-run")
126126

127127
assert len(result) == 1
128-
mock_async_client.benchmarks.runs.list.assert_awaited_once_with(
128+
mock_async_client.benchmark_runs.list.assert_awaited_once_with(
129129
benchmark_id="bmd_123", limit=10, name="test-run"
130130
)

tests/sdk/test_async_benchmark_run.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,55 +26,55 @@ def test_repr(self, mock_async_client: AsyncMock) -> None:
2626

2727
async def test_get_info(self, mock_async_client: AsyncMock, benchmark_run_view: MockBenchmarkRunView) -> None:
2828
"""Test get_info method."""
29-
mock_async_client.benchmarks.runs.retrieve = AsyncMock(return_value=benchmark_run_view)
29+
mock_async_client.benchmark_runs.retrieve = AsyncMock(return_value=benchmark_run_view)
3030

3131
run = AsyncBenchmarkRun(mock_async_client, "bmr_123", "bmd_123")
3232
result = await run.get_info()
3333

3434
assert result == benchmark_run_view
35-
mock_async_client.benchmarks.runs.retrieve.assert_awaited_once_with("bmr_123")
35+
mock_async_client.benchmark_runs.retrieve.assert_awaited_once_with("bmr_123")
3636

3737
async def test_cancel(self, mock_async_client: AsyncMock, benchmark_run_view: MockBenchmarkRunView) -> None:
3838
"""Test cancel method."""
3939
benchmark_run_view.state = "canceled"
40-
mock_async_client.benchmarks.runs.cancel = AsyncMock(return_value=benchmark_run_view)
40+
mock_async_client.benchmark_runs.cancel = AsyncMock(return_value=benchmark_run_view)
4141

4242
run = AsyncBenchmarkRun(mock_async_client, "bmr_123", "bmd_123")
4343
result = await run.cancel()
4444

4545
assert result == benchmark_run_view
4646
assert result.state == "canceled"
47-
mock_async_client.benchmarks.runs.cancel.assert_awaited_once_with("bmr_123")
47+
mock_async_client.benchmark_runs.cancel.assert_awaited_once_with("bmr_123")
4848

4949
async def test_complete(self, mock_async_client: AsyncMock, benchmark_run_view: MockBenchmarkRunView) -> None:
5050
"""Test complete method."""
5151
benchmark_run_view.state = "completed"
52-
mock_async_client.benchmarks.runs.complete = AsyncMock(return_value=benchmark_run_view)
52+
mock_async_client.benchmark_runs.complete = AsyncMock(return_value=benchmark_run_view)
5353

5454
run = AsyncBenchmarkRun(mock_async_client, "bmr_123", "bmd_123")
5555
result = await run.complete()
5656

5757
assert result == benchmark_run_view
5858
assert result.state == "completed"
59-
mock_async_client.benchmarks.runs.complete.assert_awaited_once_with("bmr_123")
59+
mock_async_client.benchmark_runs.complete.assert_awaited_once_with("bmr_123")
6060

6161
async def test_list_scenario_runs_empty(self, mock_async_client: AsyncMock) -> None:
6262
"""Test list_scenario_runs method with empty results."""
6363
page = SimpleNamespace(runs=[])
64-
mock_async_client.benchmarks.runs.list_scenario_runs = AsyncMock(return_value=page)
64+
mock_async_client.benchmark_runs.list_scenario_runs = AsyncMock(return_value=page)
6565

6666
run = AsyncBenchmarkRun(mock_async_client, "bmr_123", "bmd_123")
6767
result = await run.list_scenario_runs()
6868

6969
assert len(result) == 0
70-
mock_async_client.benchmarks.runs.list_scenario_runs.assert_awaited_once_with("bmr_123")
70+
mock_async_client.benchmark_runs.list_scenario_runs.assert_awaited_once_with("bmr_123")
7171

7272
async def test_list_scenario_runs_single(
7373
self, mock_async_client: AsyncMock, scenario_run_view: MockScenarioRunView
7474
) -> None:
7575
"""Test list_scenario_runs method with single result."""
7676
page = SimpleNamespace(runs=[scenario_run_view])
77-
mock_async_client.benchmarks.runs.list_scenario_runs = AsyncMock(return_value=page)
77+
mock_async_client.benchmark_runs.list_scenario_runs = AsyncMock(return_value=page)
7878

7979
run = AsyncBenchmarkRun(mock_async_client, "bmr_123", "bmd_123")
8080
result = await run.list_scenario_runs()
@@ -83,14 +83,14 @@ async def test_list_scenario_runs_single(
8383
assert isinstance(result[0], AsyncScenarioRun)
8484
assert result[0].id == scenario_run_view.id
8585
assert result[0].devbox_id == scenario_run_view.devbox_id
86-
mock_async_client.benchmarks.runs.list_scenario_runs.assert_awaited_once_with("bmr_123")
86+
mock_async_client.benchmark_runs.list_scenario_runs.assert_awaited_once_with("bmr_123")
8787

8888
async def test_list_scenario_runs_multiple(self, mock_async_client: AsyncMock) -> None:
8989
"""Test list_scenario_runs method with multiple results."""
9090
scenario_run_view1 = MockScenarioRunView(id="scr_001", devbox_id="dev_001")
9191
scenario_run_view2 = MockScenarioRunView(id="scr_002", devbox_id="dev_002")
9292
page = SimpleNamespace(runs=[scenario_run_view1, scenario_run_view2])
93-
mock_async_client.benchmarks.runs.list_scenario_runs = AsyncMock(return_value=page)
93+
mock_async_client.benchmark_runs.list_scenario_runs = AsyncMock(return_value=page)
9494

9595
run = AsyncBenchmarkRun(mock_async_client, "bmr_123", "bmd_123")
9696
result = await run.list_scenario_runs()
@@ -100,21 +100,21 @@ async def test_list_scenario_runs_multiple(self, mock_async_client: AsyncMock) -
100100
assert isinstance(result[1], AsyncScenarioRun)
101101
assert result[0].id == "scr_001"
102102
assert result[1].id == "scr_002"
103-
mock_async_client.benchmarks.runs.list_scenario_runs.assert_awaited_once_with("bmr_123")
103+
mock_async_client.benchmark_runs.list_scenario_runs.assert_awaited_once_with("bmr_123")
104104

105105
async def test_list_scenario_runs_with_params(
106106
self, mock_async_client: AsyncMock, scenario_run_view: MockScenarioRunView
107107
) -> None:
108108
"""Test list_scenario_runs method with filtering parameters."""
109109
page = SimpleNamespace(runs=[scenario_run_view])
110-
mock_async_client.benchmarks.runs.list_scenario_runs = AsyncMock(return_value=page)
110+
mock_async_client.benchmark_runs.list_scenario_runs = AsyncMock(return_value=page)
111111

112112
run = AsyncBenchmarkRun(mock_async_client, "bmr_123", "bmd_123")
113113
result = await run.list_scenario_runs(limit=10, state="completed")
114114

115115
assert len(result) == 1
116116
assert isinstance(result[0], AsyncScenarioRun)
117117
assert result[0].id == scenario_run_view.id
118-
mock_async_client.benchmarks.runs.list_scenario_runs.assert_awaited_once_with(
118+
mock_async_client.benchmark_runs.list_scenario_runs.assert_awaited_once_with(
119119
"bmr_123", limit=10, state="completed"
120120
)

tests/sdk/test_benchmark.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_remove_scenarios(self, mock_client: Mock, benchmark_view: MockBenchmark
8080
def test_list_runs_single(self, mock_client: Mock, benchmark_run_view: MockBenchmarkRunView) -> None:
8181
"""Test list_runs method with single result."""
8282
page = SimpleNamespace(runs=[benchmark_run_view])
83-
mock_client.benchmarks.runs.list.return_value = page
83+
mock_client.benchmark_runs.list.return_value = page
8484

8585
benchmark = Benchmark(mock_client, "bmd_123")
8686
result = benchmark.list_runs()
@@ -89,14 +89,14 @@ def test_list_runs_single(self, mock_client: Mock, benchmark_run_view: MockBench
8989
assert isinstance(result[0], BenchmarkRun)
9090
assert result[0].id == benchmark_run_view.id
9191
assert result[0].benchmark_id == benchmark_run_view.benchmark_id
92-
mock_client.benchmarks.runs.list.assert_called_once_with(benchmark_id="bmd_123")
92+
mock_client.benchmark_runs.list.assert_called_once_with(benchmark_id="bmd_123")
9393

9494
def test_list_runs_multiple(self, mock_client: Mock) -> None:
9595
"""Test list_runs method with multiple results."""
9696
run_view1 = MockBenchmarkRunView(id="bmr_001")
9797
run_view2 = MockBenchmarkRunView(id="bmr_002")
9898
page = SimpleNamespace(runs=[run_view1, run_view2])
99-
mock_client.benchmarks.runs.list.return_value = page
99+
mock_client.benchmark_runs.list.return_value = page
100100

101101
benchmark = Benchmark(mock_client, "bmd_123")
102102
result = benchmark.list_runs()
@@ -108,15 +108,15 @@ def test_list_runs_multiple(self, mock_client: Mock) -> None:
108108
assert result[0].benchmark_id == run_view1.benchmark_id
109109
assert result[1].id == run_view2.id
110110
assert result[1].benchmark_id == run_view2.benchmark_id
111-
mock_client.benchmarks.runs.list.assert_called_once_with(benchmark_id="bmd_123")
111+
mock_client.benchmark_runs.list.assert_called_once_with(benchmark_id="bmd_123")
112112

113113
def test_list_runs_with_params(self, mock_client: Mock, benchmark_run_view: MockBenchmarkRunView) -> None:
114114
"""Test list_runs method with filtering parameters."""
115115
page = SimpleNamespace(runs=[benchmark_run_view])
116-
mock_client.benchmarks.runs.list.return_value = page
116+
mock_client.benchmark_runs.list.return_value = page
117117

118118
benchmark = Benchmark(mock_client, "bmd_123")
119119
result = benchmark.list_runs(limit=10, name="test-run")
120120

121121
assert len(result) == 1
122-
mock_client.benchmarks.runs.list.assert_called_once_with(benchmark_id="bmd_123", limit=10, name="test-run")
122+
mock_client.benchmark_runs.list.assert_called_once_with(benchmark_id="bmd_123", limit=10, name="test-run")

tests/sdk/test_benchmark_run.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,53 +26,53 @@ def test_repr(self, mock_client: Mock) -> None:
2626

2727
def test_get_info(self, mock_client: Mock, benchmark_run_view: MockBenchmarkRunView) -> None:
2828
"""Test get_info method."""
29-
mock_client.benchmarks.runs.retrieve.return_value = benchmark_run_view
29+
mock_client.benchmark_runs.retrieve.return_value = benchmark_run_view
3030

3131
run = BenchmarkRun(mock_client, "bmr_123", "bmd_123")
3232
result = run.get_info()
3333

3434
assert result == benchmark_run_view
35-
mock_client.benchmarks.runs.retrieve.assert_called_once_with("bmr_123")
35+
mock_client.benchmark_runs.retrieve.assert_called_once_with("bmr_123")
3636

3737
def test_cancel(self, mock_client: Mock, benchmark_run_view: MockBenchmarkRunView) -> None:
3838
"""Test cancel method."""
3939
benchmark_run_view.state = "canceled"
40-
mock_client.benchmarks.runs.cancel.return_value = benchmark_run_view
40+
mock_client.benchmark_runs.cancel.return_value = benchmark_run_view
4141

4242
run = BenchmarkRun(mock_client, "bmr_123", "bmd_123")
4343
result = run.cancel()
4444

4545
assert result == benchmark_run_view
4646
assert result.state == "canceled"
47-
mock_client.benchmarks.runs.cancel.assert_called_once_with("bmr_123")
47+
mock_client.benchmark_runs.cancel.assert_called_once_with("bmr_123")
4848

4949
def test_complete(self, mock_client: Mock, benchmark_run_view: MockBenchmarkRunView) -> None:
5050
"""Test complete method."""
5151
benchmark_run_view.state = "completed"
52-
mock_client.benchmarks.runs.complete.return_value = benchmark_run_view
52+
mock_client.benchmark_runs.complete.return_value = benchmark_run_view
5353

5454
run = BenchmarkRun(mock_client, "bmr_123", "bmd_123")
5555
result = run.complete()
5656

5757
assert result == benchmark_run_view
5858
assert result.state == "completed"
59-
mock_client.benchmarks.runs.complete.assert_called_once_with("bmr_123")
59+
mock_client.benchmark_runs.complete.assert_called_once_with("bmr_123")
6060

6161
def test_list_scenario_runs_empty(self, mock_client: Mock) -> None:
6262
"""Test list_scenario_runs method with empty results."""
6363
page = SimpleNamespace(runs=[])
64-
mock_client.benchmarks.runs.list_scenario_runs.return_value = page
64+
mock_client.benchmark_runs.list_scenario_runs.return_value = page
6565

6666
run = BenchmarkRun(mock_client, "bmr_123", "bmd_123")
6767
result = run.list_scenario_runs()
6868

6969
assert len(result) == 0
70-
mock_client.benchmarks.runs.list_scenario_runs.assert_called_once_with("bmr_123")
70+
mock_client.benchmark_runs.list_scenario_runs.assert_called_once_with("bmr_123")
7171

7272
def test_list_scenario_runs_single(self, mock_client: Mock, scenario_run_view: MockScenarioRunView) -> None:
7373
"""Test list_scenario_runs method with single result."""
7474
page = SimpleNamespace(runs=[scenario_run_view])
75-
mock_client.benchmarks.runs.list_scenario_runs.return_value = page
75+
mock_client.benchmark_runs.list_scenario_runs.return_value = page
7676

7777
run = BenchmarkRun(mock_client, "bmr_123", "bmd_123")
7878
result = run.list_scenario_runs()
@@ -81,14 +81,14 @@ def test_list_scenario_runs_single(self, mock_client: Mock, scenario_run_view: M
8181
assert isinstance(result[0], ScenarioRun)
8282
assert result[0].id == scenario_run_view.id
8383
assert result[0].devbox_id == scenario_run_view.devbox_id
84-
mock_client.benchmarks.runs.list_scenario_runs.assert_called_once_with("bmr_123")
84+
mock_client.benchmark_runs.list_scenario_runs.assert_called_once_with("bmr_123")
8585

8686
def test_list_scenario_runs_multiple(self, mock_client: Mock) -> None:
8787
"""Test list_scenario_runs method with multiple results."""
8888
scenario_run_view1 = MockScenarioRunView(id="scr_001", devbox_id="dev_001")
8989
scenario_run_view2 = MockScenarioRunView(id="scr_002", devbox_id="dev_002")
9090
page = SimpleNamespace(runs=[scenario_run_view1, scenario_run_view2])
91-
mock_client.benchmarks.runs.list_scenario_runs.return_value = page
91+
mock_client.benchmark_runs.list_scenario_runs.return_value = page
9292

9393
run = BenchmarkRun(mock_client, "bmr_123", "bmd_123")
9494
result = run.list_scenario_runs()
@@ -98,17 +98,17 @@ def test_list_scenario_runs_multiple(self, mock_client: Mock) -> None:
9898
assert isinstance(result[1], ScenarioRun)
9999
assert result[0].id == "scr_001"
100100
assert result[1].id == "scr_002"
101-
mock_client.benchmarks.runs.list_scenario_runs.assert_called_once_with("bmr_123")
101+
mock_client.benchmark_runs.list_scenario_runs.assert_called_once_with("bmr_123")
102102

103103
def test_list_scenario_runs_with_params(self, mock_client: Mock, scenario_run_view: MockScenarioRunView) -> None:
104104
"""Test list_scenario_runs method with filtering parameters."""
105105
page = SimpleNamespace(runs=[scenario_run_view])
106-
mock_client.benchmarks.runs.list_scenario_runs.return_value = page
106+
mock_client.benchmark_runs.list_scenario_runs.return_value = page
107107

108108
run = BenchmarkRun(mock_client, "bmr_123", "bmd_123")
109109
result = run.list_scenario_runs(limit=10, state="completed")
110110

111111
assert len(result) == 1
112112
assert isinstance(result[0], ScenarioRun)
113113
assert result[0].id == scenario_run_view.id
114-
mock_client.benchmarks.runs.list_scenario_runs.assert_called_once_with("bmr_123", limit=10, state="completed")
114+
mock_client.benchmark_runs.list_scenario_runs.assert_called_once_with("bmr_123", limit=10, state="completed")

0 commit comments

Comments
 (0)