@@ -165,6 +165,63 @@ def test_branch_resize(client, org, project, branch_id):
165165 )
166166
167167
168+ def test_branch_resize_cpu (client , org , project , branch_id ):
169+ r = client .post (
170+ f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /resize" ,
171+ json = {"milli_vcpu" : 1000 },
172+ )
173+ assert r .status_code == 202
174+ wait_for_status (
175+ client ,
176+ f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /" ,
177+ "ACTIVE_HEALTHY" ,
178+ BRANCH_TIMEOUT_SEC ,
179+ )
180+ r = client .get (f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /" )
181+ assert r .status_code == 200
182+ assert r .json ()["max_resources" ]["milli_vcpu" ] == 1000
183+
184+
185+ def test_branch_resize_memory (client , org , project , branch_id ):
186+ # 2 GiB expressed in bytes (must be a multiple of 256 MiB)
187+ two_gib = 2 * 1024 * 1024 * 1024
188+ r = client .post (
189+ f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /resize" ,
190+ json = {"memory_bytes" : two_gib },
191+ )
192+ assert r .status_code == 202
193+ wait_for_status (
194+ client ,
195+ f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /" ,
196+ "ACTIVE_HEALTHY" ,
197+ BRANCH_TIMEOUT_SEC ,
198+ )
199+ r = client .get (f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /" )
200+ assert r .status_code == 200
201+ assert r .json ()["max_resources" ]["ram_bytes" ] == two_gib
202+
203+
204+ def test_branch_resize_database_size (client , org , project , branch_id ):
205+ # 6 GB expressed in bytes (must be a multiple of 1 GB)
206+ six_gb = 6 * 1_000_000_000
207+ # due to issues related to round up
208+ seven_gb = 7 * 1_000_000_000
209+ r = client .post (
210+ f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /resize" ,
211+ json = {"database_size" : six_gb },
212+ )
213+ assert r .status_code == 202
214+ wait_for_status (
215+ client ,
216+ f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /" ,
217+ "ACTIVE_HEALTHY" ,
218+ BRANCH_TIMEOUT_SEC ,
219+ )
220+ r = client .get (f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /" )
221+ assert r .status_code == 200
222+ assert r .json ()["max_resources" ]["nvme_bytes" ] == seven_gb
223+
224+
168225def test_branch_password_reset (client , org , project , branch_id ):
169226 r = client .post (
170227 f"organizations/{ org } /projects/{ project } /branches/{ branch_id } /reset-password" ,
0 commit comments