File tree Expand file tree Collapse file tree 6 files changed +36
-36
lines changed
tests/test_tutorial/test_fastapi/test_update Expand file tree Collapse file tree 6 files changed +36
-36
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,17 @@ def test_tutorial(clear_sqlmodel):
4949 data = response .json ()
5050 assert response .status_code == 200 , response .text
5151 assert data ["name" ] == hero2_data ["name" ], "The name should not be set to none"
52- assert (
53- data [ "secret_name" ] == "Spider-Youngster "
54- ), "The secret name should be updated"
52+ assert data [ "secret_name" ] == "Spider-Youngster" , (
53+ "The secret name should be updated "
54+ )
5555
5656 response = client .patch (f"/heroes/{ hero3_id } " , json = {"age" : None })
5757 data = response .json ()
5858 assert response .status_code == 200 , response .text
5959 assert data ["name" ] == hero3_data ["name" ]
60- assert (
61- data [ "age" ] is None
62- ), "A field should be updatable to None, even if that's the default"
60+ assert data [ "age" ] is None , (
61+ "A field should be updatable to None, even if that's the default"
62+ )
6363
6464 response = client .patch ("/heroes/9001" , json = {"name" : "Dragon Cube X" })
6565 assert response .status_code == 404 , response .text
Original file line number Diff line number Diff line change @@ -52,17 +52,17 @@ def test_tutorial(clear_sqlmodel):
5252 data = response .json ()
5353 assert response .status_code == 200 , response .text
5454 assert data ["name" ] == hero2_data ["name" ], "The name should not be set to none"
55- assert (
56- data [ "secret_name" ] == "Spider-Youngster "
57- ), "The secret name should be updated"
55+ assert data [ "secret_name" ] == "Spider-Youngster" , (
56+ "The secret name should be updated "
57+ )
5858
5959 response = client .patch (f"/heroes/{ hero3_id } " , json = {"age" : None })
6060 data = response .json ()
6161 assert response .status_code == 200 , response .text
6262 assert data ["name" ] == hero3_data ["name" ]
63- assert (
64- data [ "age" ] is None
65- ), "A field should be updatable to None, even if that's the default"
63+ assert data [ "age" ] is None , (
64+ "A field should be updatable to None, even if that's the default"
65+ )
6666
6767 response = client .patch ("/heroes/9001" , json = {"name" : "Dragon Cube X" })
6868 assert response .status_code == 404 , response .text
Original file line number Diff line number Diff line change @@ -52,17 +52,17 @@ def test_tutorial(clear_sqlmodel):
5252 data = response .json ()
5353 assert response .status_code == 200 , response .text
5454 assert data ["name" ] == hero2_data ["name" ], "The name should not be set to none"
55- assert (
56- data [ "secret_name" ] == "Spider-Youngster "
57- ), "The secret name should be updated"
55+ assert data [ "secret_name" ] == "Spider-Youngster" , (
56+ "The secret name should be updated "
57+ )
5858
5959 response = client .patch (f"/heroes/{ hero3_id } " , json = {"age" : None })
6060 data = response .json ()
6161 assert response .status_code == 200 , response .text
6262 assert data ["name" ] == hero3_data ["name" ]
63- assert (
64- data [ "age" ] is None
65- ), "A field should be updatable to None, even if that's the default"
63+ assert data [ "age" ] is None , (
64+ "A field should be updatable to None, even if that's the default"
65+ )
6666
6767 response = client .patch ("/heroes/9001" , json = {"name" : "Dragon Cube X" })
6868 assert response .status_code == 404 , response .text
Original file line number Diff line number Diff line change @@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel):
8080 data = response .json ()
8181 assert response .status_code == 200 , response .text
8282 assert data ["name" ] == hero2_data ["name" ], "The name should not be set to none"
83- assert (
84- data [ "secret_name" ] == "Spider-Youngster "
85- ), "The secret name should be updated"
83+ assert data [ "secret_name" ] == "Spider-Youngster" , (
84+ "The secret name should be updated "
85+ )
8686 assert "password" not in data
8787 assert "hashed_password" not in data
8888 with Session (mod .engine ) as session :
@@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel):
9595 data = response .json ()
9696 assert response .status_code == 200 , response .text
9797 assert data ["name" ] == hero3_data ["name" ]
98- assert (
99- data [ "age" ] is None
100- ), "A field should be updatable to None, even if that's the default"
98+ assert data [ "age" ] is None , (
99+ "A field should be updatable to None, even if that's the default"
100+ )
101101 assert "password" not in data
102102 assert "hashed_password" not in data
103103 with Session (mod .engine ) as session :
Original file line number Diff line number Diff line change @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
8383 data = response .json ()
8484 assert response .status_code == 200 , response .text
8585 assert data ["name" ] == hero2_data ["name" ], "The name should not be set to none"
86- assert (
87- data [ "secret_name" ] == "Spider-Youngster "
88- ), "The secret name should be updated"
86+ assert data [ "secret_name" ] == "Spider-Youngster" , (
87+ "The secret name should be updated "
88+ )
8989 assert "password" not in data
9090 assert "hashed_password" not in data
9191 with Session (mod .engine ) as session :
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
9898 data = response .json ()
9999 assert response .status_code == 200 , response .text
100100 assert data ["name" ] == hero3_data ["name" ]
101- assert (
102- data [ "age" ] is None
103- ), "A field should be updatable to None, even if that's the default"
101+ assert data [ "age" ] is None , (
102+ "A field should be updatable to None, even if that's the default"
103+ )
104104 assert "password" not in data
105105 assert "hashed_password" not in data
106106 with Session (mod .engine ) as session :
Original file line number Diff line number Diff line change @@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
8383 data = response .json ()
8484 assert response .status_code == 200 , response .text
8585 assert data ["name" ] == hero2_data ["name" ], "The name should not be set to none"
86- assert (
87- data [ "secret_name" ] == "Spider-Youngster "
88- ), "The secret name should be updated"
86+ assert data [ "secret_name" ] == "Spider-Youngster" , (
87+ "The secret name should be updated "
88+ )
8989 assert "password" not in data
9090 assert "hashed_password" not in data
9191 with Session (mod .engine ) as session :
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
9898 data = response .json ()
9999 assert response .status_code == 200 , response .text
100100 assert data ["name" ] == hero3_data ["name" ]
101- assert (
102- data [ "age" ] is None
103- ), "A field should be updatable to None, even if that's the default"
101+ assert data [ "age" ] is None , (
102+ "A field should be updatable to None, even if that's the default"
103+ )
104104 assert "password" not in data
105105 assert "hashed_password" not in data
106106 with Session (mod .engine ) as session :
You can’t perform that action at this time.
0 commit comments