wavespeed 0.1.2__tar.gz → 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wavespeed-0.1.2 → wavespeed-1.0.4}/PKG-INFO +5 -5
- {wavespeed-0.1.2 → wavespeed-1.0.4}/README.md +4 -4
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/__init__.py +1 -1
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/_version.py +1 -1
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/api/__init__.py +5 -5
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/api/client.py +13 -7
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/logger.py +4 -2
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed.egg-info/PKG-INFO +5 -5
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_api.py +5 -7
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_http.py +3 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_scaler.py +2 -2
- {wavespeed-0.1.2 → wavespeed-1.0.4}/.github/workflows/claude-code-review.yml +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/.github/workflows/claude.yml +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/.github/workflows/pre-commit.yml +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/.github/workflows/python-packages.yml +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/.github/workflows/python-publish.yml +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/.gitignore +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/.pre-commit-config.yaml +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/CLAUDE.md +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/LICENSE +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/MANIFEST.in +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/VERSIONING.md +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/images/build_and_push.sh +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/images/test_worker/Dockerfile +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/images/test_worker/build_and_test.sh +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/images/test_worker/handler.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/images/test_worker/requirements.txt +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/images/test_worker/test_input.json +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/pyproject.toml +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/pytest.ini +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/setup.cfg +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/_config_module.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/config.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/__init__.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/__init__.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/fastapi.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/handler.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/heartbeat.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/http.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/job.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/local.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/progress.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/scaler.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/modules/state.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/utils/__init__.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/utils/boto3_utils.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/utils/validator.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed/serverless/worker.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed.egg-info/SOURCES.txt +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed.egg-info/dependency_links.txt +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed.egg-info/not-zip-safe +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed.egg-info/requires.txt +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/src/wavespeed.egg-info/top_level.txt +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/__init__.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/conftest.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_config.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/__init__.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/__init__.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_fastapi.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_handler.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_job.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_local.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_logger.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_progress.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_modules/test_state.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_utils/__init__.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_utils/test_validator.py +0 -0
- {wavespeed-0.1.2 → wavespeed-1.0.4}/tests/test_serverless/test_worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wavespeed
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: WaveSpeedAI Python Client — Official Python SDK for WaveSpeedAI inference platform
|
|
5
5
|
Author-email: WaveSpeedAI <support@wavespeed.ai>
|
|
6
6
|
License: MIT
|
|
@@ -62,7 +62,7 @@ import wavespeed
|
|
|
62
62
|
|
|
63
63
|
output = wavespeed.run(
|
|
64
64
|
"wavespeed-ai/z-image/turbo",
|
|
65
|
-
|
|
65
|
+
{"prompt": "Cat"},
|
|
66
66
|
)
|
|
67
67
|
|
|
68
68
|
print(output["outputs"][0]) # Output URL
|
|
@@ -82,7 +82,7 @@ Or pass it directly:
|
|
|
82
82
|
from wavespeed import Client
|
|
83
83
|
|
|
84
84
|
client = Client(api_key="your-api-key")
|
|
85
|
-
output = client.run("wavespeed-ai/z-image/turbo",
|
|
85
|
+
output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
### Options
|
|
@@ -90,7 +90,7 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
|
|
|
90
90
|
```python
|
|
91
91
|
output = wavespeed.run(
|
|
92
92
|
"wavespeed-ai/z-image/turbo",
|
|
93
|
-
|
|
93
|
+
{"prompt": "Cat"},
|
|
94
94
|
timeout=36000.0, # Max wait time in seconds (default: 36000.0)
|
|
95
95
|
poll_interval=1.0, # Status check interval (default: 1.0)
|
|
96
96
|
enable_sync_mode=False, # Single request mode, no polling (default: False)
|
|
@@ -106,7 +106,7 @@ Use `enable_sync_mode=True` for a single request that waits for the result (no p
|
|
|
106
106
|
```python
|
|
107
107
|
output = wavespeed.run(
|
|
108
108
|
"wavespeed-ai/z-image/turbo",
|
|
109
|
-
|
|
109
|
+
{"prompt": "Cat"},
|
|
110
110
|
enable_sync_mode=True,
|
|
111
111
|
)
|
|
112
112
|
```
|
|
@@ -33,7 +33,7 @@ import wavespeed
|
|
|
33
33
|
|
|
34
34
|
output = wavespeed.run(
|
|
35
35
|
"wavespeed-ai/z-image/turbo",
|
|
36
|
-
|
|
36
|
+
{"prompt": "Cat"},
|
|
37
37
|
)
|
|
38
38
|
|
|
39
39
|
print(output["outputs"][0]) # Output URL
|
|
@@ -53,7 +53,7 @@ Or pass it directly:
|
|
|
53
53
|
from wavespeed import Client
|
|
54
54
|
|
|
55
55
|
client = Client(api_key="your-api-key")
|
|
56
|
-
output = client.run("wavespeed-ai/z-image/turbo",
|
|
56
|
+
output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
### Options
|
|
@@ -61,7 +61,7 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
|
|
|
61
61
|
```python
|
|
62
62
|
output = wavespeed.run(
|
|
63
63
|
"wavespeed-ai/z-image/turbo",
|
|
64
|
-
|
|
64
|
+
{"prompt": "Cat"},
|
|
65
65
|
timeout=36000.0, # Max wait time in seconds (default: 36000.0)
|
|
66
66
|
poll_interval=1.0, # Status check interval (default: 1.0)
|
|
67
67
|
enable_sync_mode=False, # Single request mode, no polling (default: False)
|
|
@@ -77,7 +77,7 @@ Use `enable_sync_mode=True` for a single request that waits for the result (no p
|
|
|
77
77
|
```python
|
|
78
78
|
output = wavespeed.run(
|
|
79
79
|
"wavespeed-ai/z-image/turbo",
|
|
80
|
-
|
|
80
|
+
{"prompt": "Cat"},
|
|
81
81
|
enable_sync_mode=True,
|
|
82
82
|
)
|
|
83
83
|
```
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# This file is automatically generated by setuptools_scm
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "1.0.4"
|
|
@@ -7,7 +7,7 @@ Example usage:
|
|
|
7
7
|
|
|
8
8
|
output = wavespeed.run(
|
|
9
9
|
"wavespeed-ai/z-image/turbo",
|
|
10
|
-
|
|
10
|
+
{"prompt": "A beautiful sunset over mountains"}
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
print(output["outputs"][0]) # First output URL
|
|
@@ -65,27 +65,27 @@ def run(
|
|
|
65
65
|
Example:
|
|
66
66
|
output = wavespeed.run(
|
|
67
67
|
"wavespeed-ai/z-image/turbo",
|
|
68
|
-
|
|
68
|
+
{"prompt": "A cat sitting on a windowsill"}
|
|
69
69
|
)
|
|
70
70
|
print(output["outputs"][0]) # First output URL
|
|
71
71
|
|
|
72
72
|
# With sync mode
|
|
73
73
|
output = wavespeed.run(
|
|
74
74
|
"wavespeed-ai/z-image/turbo",
|
|
75
|
-
|
|
75
|
+
{"prompt": "A cat"},
|
|
76
76
|
enable_sync_mode=True
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
# With retry
|
|
80
80
|
output = wavespeed.run(
|
|
81
81
|
"wavespeed-ai/z-image/turbo",
|
|
82
|
-
|
|
82
|
+
{"prompt": "A cat"},
|
|
83
83
|
max_retries=3
|
|
84
84
|
)
|
|
85
85
|
"""
|
|
86
86
|
return _get_default_client().run(
|
|
87
87
|
model,
|
|
88
|
-
input
|
|
88
|
+
input,
|
|
89
89
|
timeout=timeout,
|
|
90
90
|
poll_interval=poll_interval,
|
|
91
91
|
enable_sync_mode=enable_sync_mode,
|
|
@@ -23,13 +23,13 @@ class Client:
|
|
|
23
23
|
|
|
24
24
|
Example:
|
|
25
25
|
client = Client(api_key="your-api-key")
|
|
26
|
-
output = client.run("wavespeed-ai/z-image/turbo",
|
|
26
|
+
output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
|
|
27
27
|
|
|
28
28
|
# With sync mode (single request, waits for result)
|
|
29
|
-
output = client.run("wavespeed-ai/z-image/turbo",
|
|
29
|
+
output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"}, enable_sync_mode=True)
|
|
30
30
|
|
|
31
31
|
# With retry
|
|
32
|
-
output = client.run("wavespeed-ai/z-image/turbo",
|
|
32
|
+
output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"}, max_retries=3)
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
35
|
def __init__(
|
|
@@ -179,7 +179,8 @@ class Client:
|
|
|
179
179
|
|
|
180
180
|
if response.status_code != 200:
|
|
181
181
|
raise RuntimeError(
|
|
182
|
-
f"Failed to get result
|
|
182
|
+
f"Failed to get result for task {request_id}: "
|
|
183
|
+
f"HTTP {response.status_code}: {response.text}"
|
|
183
184
|
)
|
|
184
185
|
|
|
185
186
|
return response.json()
|
|
@@ -199,7 +200,8 @@ class Client:
|
|
|
199
200
|
time.sleep(delay)
|
|
200
201
|
else:
|
|
201
202
|
raise RuntimeError(
|
|
202
|
-
f"Failed to get result
|
|
203
|
+
f"Failed to get result for task {request_id} "
|
|
204
|
+
f"after {self.max_connection_retries + 1} attempts"
|
|
203
205
|
) from e
|
|
204
206
|
|
|
205
207
|
def _wait(
|
|
@@ -229,7 +231,9 @@ class Client:
|
|
|
229
231
|
if timeout is not None:
|
|
230
232
|
elapsed = time.time() - start_time
|
|
231
233
|
if elapsed >= timeout:
|
|
232
|
-
raise TimeoutError(
|
|
234
|
+
raise TimeoutError(
|
|
235
|
+
f"Prediction timed out after {timeout} seconds (task_id: {request_id})"
|
|
236
|
+
)
|
|
233
237
|
|
|
234
238
|
result = self._get_result(request_id, timeout=timeout)
|
|
235
239
|
data = result.get("data", {})
|
|
@@ -240,7 +244,9 @@ class Client:
|
|
|
240
244
|
|
|
241
245
|
if status == "failed":
|
|
242
246
|
error = data.get("error") or "Unknown error"
|
|
243
|
-
raise RuntimeError(
|
|
247
|
+
raise RuntimeError(
|
|
248
|
+
f"Prediction failed (task_id: {request_id}): {error}"
|
|
249
|
+
)
|
|
244
250
|
|
|
245
251
|
time.sleep(poll_interval)
|
|
246
252
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
import sys
|
|
5
|
-
from datetime import datetime
|
|
5
|
+
from datetime import datetime, timezone
|
|
6
6
|
from enum import IntEnum
|
|
7
7
|
from typing import Optional
|
|
8
8
|
|
|
@@ -113,7 +113,9 @@ class WaverlessLogger:
|
|
|
113
113
|
"requestId": job_id or "N/A",
|
|
114
114
|
"message": message,
|
|
115
115
|
"level": level.name,
|
|
116
|
-
"timestamp": datetime.
|
|
116
|
+
"timestamp": datetime.now(timezone.utc)
|
|
117
|
+
.isoformat()
|
|
118
|
+
.replace("+00:00", "Z"),
|
|
117
119
|
}
|
|
118
120
|
return json.dumps(log_data)
|
|
119
121
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wavespeed
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: WaveSpeedAI Python Client — Official Python SDK for WaveSpeedAI inference platform
|
|
5
5
|
Author-email: WaveSpeedAI <support@wavespeed.ai>
|
|
6
6
|
License: MIT
|
|
@@ -62,7 +62,7 @@ import wavespeed
|
|
|
62
62
|
|
|
63
63
|
output = wavespeed.run(
|
|
64
64
|
"wavespeed-ai/z-image/turbo",
|
|
65
|
-
|
|
65
|
+
{"prompt": "Cat"},
|
|
66
66
|
)
|
|
67
67
|
|
|
68
68
|
print(output["outputs"][0]) # Output URL
|
|
@@ -82,7 +82,7 @@ Or pass it directly:
|
|
|
82
82
|
from wavespeed import Client
|
|
83
83
|
|
|
84
84
|
client = Client(api_key="your-api-key")
|
|
85
|
-
output = client.run("wavespeed-ai/z-image/turbo",
|
|
85
|
+
output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
### Options
|
|
@@ -90,7 +90,7 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
|
|
|
90
90
|
```python
|
|
91
91
|
output = wavespeed.run(
|
|
92
92
|
"wavespeed-ai/z-image/turbo",
|
|
93
|
-
|
|
93
|
+
{"prompt": "Cat"},
|
|
94
94
|
timeout=36000.0, # Max wait time in seconds (default: 36000.0)
|
|
95
95
|
poll_interval=1.0, # Status check interval (default: 1.0)
|
|
96
96
|
enable_sync_mode=False, # Single request mode, no polling (default: False)
|
|
@@ -106,7 +106,7 @@ Use `enable_sync_mode=True` for a single request that waits for the result (no p
|
|
|
106
106
|
```python
|
|
107
107
|
output = wavespeed.run(
|
|
108
108
|
"wavespeed-ai/z-image/turbo",
|
|
109
|
-
|
|
109
|
+
{"prompt": "Cat"},
|
|
110
110
|
enable_sync_mode=True,
|
|
111
111
|
)
|
|
112
112
|
```
|
|
@@ -118,7 +118,7 @@ class TestClient(unittest.TestCase):
|
|
|
118
118
|
mock_get.return_value = mock_get_response
|
|
119
119
|
|
|
120
120
|
client = Client(api_key="test-key")
|
|
121
|
-
result = client.run("wavespeed-ai/z-image/turbo",
|
|
121
|
+
result = client.run("wavespeed-ai/z-image/turbo", {"prompt": "test"})
|
|
122
122
|
|
|
123
123
|
self.assertEqual(result["outputs"], ["https://example.com/out.png"])
|
|
124
124
|
|
|
@@ -142,7 +142,7 @@ class TestClient(unittest.TestCase):
|
|
|
142
142
|
|
|
143
143
|
client = Client(api_key="test-key")
|
|
144
144
|
with self.assertRaises(RuntimeError) as ctx:
|
|
145
|
-
client.run("wavespeed-ai/z-image/turbo",
|
|
145
|
+
client.run("wavespeed-ai/z-image/turbo", {"prompt": "test"})
|
|
146
146
|
self.assertIn("Model error", str(ctx.exception))
|
|
147
147
|
|
|
148
148
|
@patch("wavespeed.api.client.time.time")
|
|
@@ -168,9 +168,7 @@ class TestClient(unittest.TestCase):
|
|
|
168
168
|
|
|
169
169
|
client = Client(api_key="test-key")
|
|
170
170
|
with self.assertRaises(TimeoutError) as ctx:
|
|
171
|
-
client.run(
|
|
172
|
-
"wavespeed-ai/z-image/turbo", input={"prompt": "test"}, timeout=10
|
|
173
|
-
)
|
|
171
|
+
client.run("wavespeed-ai/z-image/turbo", {"prompt": "test"}, timeout=10)
|
|
174
172
|
self.assertIn("timed out", str(ctx.exception))
|
|
175
173
|
|
|
176
174
|
|
|
@@ -208,7 +206,7 @@ class TestModuleLevelRun(unittest.TestCase):
|
|
|
208
206
|
}
|
|
209
207
|
mock_get.return_value = mock_get_response
|
|
210
208
|
|
|
211
|
-
result = wavespeed.run("wavespeed-ai/z-image/turbo",
|
|
209
|
+
result = wavespeed.run("wavespeed-ai/z-image/turbo", {"prompt": "test"})
|
|
212
210
|
self.assertEqual(result["outputs"], ["https://example.com/out.png"])
|
|
213
211
|
|
|
214
212
|
|
|
@@ -342,7 +340,7 @@ class TestRealAPI(unittest.TestCase):
|
|
|
342
340
|
|
|
343
341
|
output = wavespeed.run(
|
|
344
342
|
"wavespeed-ai/z-image/turbo",
|
|
345
|
-
|
|
343
|
+
{"prompt": "A simple red circle on white background"},
|
|
346
344
|
)
|
|
347
345
|
|
|
348
346
|
self.assertIn("outputs", output)
|
|
@@ -132,6 +132,7 @@ class TestFetchJobs(IsolatedAsyncioTestCase):
|
|
|
132
132
|
mock_response.content_type = "application/json"
|
|
133
133
|
mock_response.content_length = 100
|
|
134
134
|
mock_response.json = AsyncMock(return_value={"id": "job_1", "input": {"n": 1}})
|
|
135
|
+
mock_response.raise_for_status = MagicMock()
|
|
135
136
|
mock_response.__aenter__.return_value = mock_response
|
|
136
137
|
mock_response.__aexit__.return_value = None
|
|
137
138
|
|
|
@@ -163,6 +164,7 @@ class TestFetchJobs(IsolatedAsyncioTestCase):
|
|
|
163
164
|
{"id": "job_2", "input": {"n": 2}},
|
|
164
165
|
]
|
|
165
166
|
)
|
|
167
|
+
mock_response.raise_for_status = MagicMock()
|
|
166
168
|
mock_response.__aenter__.return_value = mock_response
|
|
167
169
|
mock_response.__aexit__.return_value = None
|
|
168
170
|
|
|
@@ -287,6 +289,7 @@ class TestFetchJobs(IsolatedAsyncioTestCase):
|
|
|
287
289
|
mock_response.content_type = "application/json"
|
|
288
290
|
mock_response.content_length = 10
|
|
289
291
|
mock_response.json = AsyncMock(return_value=[])
|
|
292
|
+
mock_response.raise_for_status = MagicMock()
|
|
290
293
|
mock_response.__aenter__.return_value = mock_response
|
|
291
294
|
mock_response.__aexit__.return_value = None
|
|
292
295
|
|
|
@@ -108,7 +108,7 @@ class TestJobScalerAsync(IsolatedAsyncioTestCase):
|
|
|
108
108
|
|
|
109
109
|
scaler = JobScaler(config)
|
|
110
110
|
scaler.job_progress = mock_progress_instance
|
|
111
|
-
scaler.jobs_queue =
|
|
111
|
+
scaler.jobs_queue = MagicMock()
|
|
112
112
|
|
|
113
113
|
# Override the jobs_handler directly since __init__ already captured handle_job
|
|
114
114
|
mock_handle = AsyncMock()
|
|
@@ -132,7 +132,7 @@ class TestJobScalerAsync(IsolatedAsyncioTestCase):
|
|
|
132
132
|
|
|
133
133
|
scaler = JobScaler(config)
|
|
134
134
|
scaler.job_progress = mock_progress_instance
|
|
135
|
-
scaler.jobs_queue =
|
|
135
|
+
scaler.jobs_queue = MagicMock()
|
|
136
136
|
|
|
137
137
|
# Override the jobs_handler directly since __init__ already captured handle_job
|
|
138
138
|
mock_handle = AsyncMock()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|