apexdevkit 1.3.13__tar.gz → 1.3.15__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.
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/PKG-INFO +1 -1
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/router.py +12 -2
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/testing/rest.py +8 -3
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/pyproject.toml +1 -1
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/LICENSE +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/README.md +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/error.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.3.13 → apexdevkit-1.3.15}/apexdevkit/testing/fake.py +0 -0
|
@@ -176,7 +176,12 @@ class RestfulRouter:
|
|
|
176
176
|
include_in_schema=is_documented,
|
|
177
177
|
)
|
|
178
178
|
def create_one(parent_id: parent_id_type, item: item_type) -> _Response:
|
|
179
|
-
|
|
179
|
+
try:
|
|
180
|
+
service = self.infra.service_for(parent_id)
|
|
181
|
+
except DoesNotExistError as e:
|
|
182
|
+
return JSONResponse(
|
|
183
|
+
RestfulResponse(RestfulName(self.parent)).not_found(e), 404
|
|
184
|
+
)
|
|
180
185
|
|
|
181
186
|
try:
|
|
182
187
|
item = service.create_one(item)
|
|
@@ -206,7 +211,12 @@ class RestfulRouter:
|
|
|
206
211
|
include_in_schema=is_documented,
|
|
207
212
|
)
|
|
208
213
|
def create_many(parent_id: parent_id_type, items: collection_type) -> _Response:
|
|
209
|
-
|
|
214
|
+
try:
|
|
215
|
+
service = self.infra.service_for(parent_id)
|
|
216
|
+
except DoesNotExistError as e:
|
|
217
|
+
return JSONResponse(
|
|
218
|
+
RestfulResponse(RestfulName(self.parent)).not_found(e), 404
|
|
219
|
+
)
|
|
210
220
|
|
|
211
221
|
try:
|
|
212
222
|
return self.response.created_many(service.create_many(items))
|
|
@@ -233,6 +233,9 @@ class RestResponse:
|
|
|
233
233
|
http_code: int
|
|
234
234
|
|
|
235
235
|
def fail(self) -> Self:
|
|
236
|
+
if self.http_code == 422:
|
|
237
|
+
return self
|
|
238
|
+
|
|
236
239
|
return self.with_status("fail")
|
|
237
240
|
|
|
238
241
|
def success(self) -> Self:
|
|
@@ -245,7 +248,9 @@ class RestResponse:
|
|
|
245
248
|
|
|
246
249
|
def with_code(self, value: int) -> Self:
|
|
247
250
|
assert self.http_code == value
|
|
248
|
-
|
|
251
|
+
|
|
252
|
+
if self.http_code != 422:
|
|
253
|
+
assert self.json.value_of("code").to(int) == value
|
|
249
254
|
|
|
250
255
|
return self
|
|
251
256
|
|
|
@@ -256,7 +261,7 @@ class RestResponse:
|
|
|
256
261
|
return self.with_message(value)
|
|
257
262
|
|
|
258
263
|
def with_message(self, value: str) -> Self:
|
|
259
|
-
assert self.json.value_of("error").to(dict) == {"message": value}
|
|
264
|
+
assert self.json.value_of("error").to(dict) == {"message": value}, self.json
|
|
260
265
|
|
|
261
266
|
return self
|
|
262
267
|
|
|
@@ -305,6 +310,6 @@ class RestResponse:
|
|
|
305
310
|
return self.with_data()
|
|
306
311
|
|
|
307
312
|
def with_data(self, **kwargs: Any) -> Self:
|
|
308
|
-
assert self.json.value_of("data").to(dict) == {**kwargs}
|
|
313
|
+
assert self.json.value_of("data").to(dict) == {**kwargs}, self.json
|
|
309
314
|
|
|
310
315
|
return self
|
|
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
|