sera-2 1.13.0__py3-none-any.whl → 1.13.1__py3-none-any.whl

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.
@@ -0,0 +1,43 @@
1
+ from __future__ import annotations
2
+
3
+ from litestar import Litestar
4
+ from litestar.testing import TestClient
5
+
6
+
7
+ def test_has(
8
+ client: TestClient[Litestar],
9
+ base_url: str,
10
+ exist_records: list[int | str],
11
+ non_exist_records: list[int | str],
12
+ ) -> None:
13
+ for record in exist_records:
14
+ resp = client.head(f"{base_url}/{record}")
15
+ assert (
16
+ resp.status_code == 204
17
+ ), f"Record {record} should exist but got {resp.status_code}"
18
+
19
+ for record in non_exist_records:
20
+ resp = client.head(f"{base_url}/{record}")
21
+ assert (
22
+ resp.status_code == 404
23
+ ), f"Record {record} should not exist but got {resp.status_code}"
24
+
25
+
26
+ def test_get_by_id(
27
+ client: TestClient[Litestar],
28
+ base_url: str,
29
+ exist_records: dict[int | str, dict],
30
+ non_exist_records: list[int | str],
31
+ ) -> None:
32
+ for record, data in exist_records.items():
33
+ resp = client.get(f"{base_url}/{record}")
34
+ assert (
35
+ resp.status_code == 200
36
+ ), f"Record {record} should exist but got {resp.status_code}"
37
+ assert resp.json() == data
38
+
39
+ for record in non_exist_records:
40
+ resp = client.get(f"{base_url}/{record}")
41
+ assert (
42
+ resp.status_code == 404
43
+ ), f"Record {record} should not exist but got {resp.status_code}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sera-2
3
- Version: 1.13.0
3
+ Version: 1.13.1
4
4
  Summary:
5
5
  Author: Binh Vu
6
6
  Author-email: bvu687@gmail.com
@@ -5,6 +5,7 @@ sera/exports/schema.py,sha256=3F5Kx3r0zOmiVpDf9vnzGhtdcuF-vfgMhBbp4Ko4fgw,4740
5
5
  sera/exports/test.py,sha256=jK1EJmLGiy7eREpnY_68IIVRH43uH8S_u5Z7STPbXOM,2002
6
6
  sera/libs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  sera/libs/api_helper.py,sha256=47y1kcwk3Xd2ZEMnUj_0OwCuUmgwOs5kYrE95BDVUn4,5411
8
+ sera/libs/api_test_helper.py,sha256=3tRr8sLN4dBSrHgKAHMmyoENI0xh7K_JLel8AvujU7k,1323
8
9
  sera/libs/base_orm.py,sha256=5hOH_diUeaABm3cpE2-9u50VRqG1QW2osPQnvVHIhIA,3365
9
10
  sera/libs/base_service.py,sha256=AX1WoTHte6Z_birkkfagkNE6BrCLTlTjQE4jEsKEaAY,5152
10
11
  sera/libs/dag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -35,6 +36,6 @@ sera/models/_parse.py,sha256=q_YZ7PrHWIN85_WW-fPP7-2gLXlGWM2-EIdbYXuG7Xg,10052
35
36
  sera/models/_property.py,sha256=4y9F58D6DoX25-6aWPBRiE72nCPQy0KWlGNDTZXSV-8,6038
36
37
  sera/models/_schema.py,sha256=VxJEiqgVvbXgcSUK4UW6JnRcggk4nsooVSE6MyXmfNY,1636
37
38
  sera/typing.py,sha256=Q4QMfbtfrCjC9tFfsZPhsAnbNX4lm4NHQ9lmjNXYdV0,772
38
- sera_2-1.13.0.dist-info/METADATA,sha256=IFUs-nyqkQ4yDQeCL507_8not1XYcKeLFYrLxLg4lc8,867
39
- sera_2-1.13.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
40
- sera_2-1.13.0.dist-info/RECORD,,
39
+ sera_2-1.13.1.dist-info/METADATA,sha256=xM2la_NEr7esZtrLlTbwARiHlqp43Y0VVqQR4zuFEmo,867
40
+ sera_2-1.13.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
41
+ sera_2-1.13.1.dist-info/RECORD,,