@@ -108,6 +108,33 @@ def test_streaming_response_create(self, client: Runloop) -> None:
108108
109109 assert cast (Any , response .is_closed ) is True
110110
111+ @parametrize
112+ def test_create_rejects_large_file_mount (self , client : Runloop ) -> None :
113+ # 512KB + 1 byte
114+ too_large_content = "a" * (512 * 1024 + 1 )
115+ with pytest .raises (ValueError , match = r"exceeds maximum size" ):
116+ client .blueprints .create (
117+ name = "name" ,
118+ file_mounts = {"/tmp/large.txt" : too_large_content },
119+ )
120+
121+ @parametrize
122+ def test_create_rejects_total_file_mount_size (self , client : Runloop ) -> None :
123+ # Two files at exactly per-file max, plus 1 extra byte across a third file to exceed 1MB total
124+ per_file_max = 512 * 1024
125+ content_a = "a" * per_file_max
126+ content_b = "b" * per_file_max
127+ content_c = "c" * 1
128+ with pytest .raises (ValueError , match = r"total file_mounts size exceeds maximum" ):
129+ client .blueprints .create (
130+ name = "name" ,
131+ file_mounts = {
132+ "/tmp/a.txt" : content_a ,
133+ "/tmp/b.txt" : content_b ,
134+ "/tmp/c.txt" : content_c ,
135+ },
136+ )
137+
111138 @parametrize
112139 def test_method_retrieve (self , client : Runloop ) -> None :
113140 blueprint = client .blueprints .retrieve (
@@ -536,6 +563,33 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No
536563
537564 assert cast (Any , response .is_closed ) is True
538565
566+ @parametrize
567+ async def test_create_rejects_large_file_mount (self , async_client : AsyncRunloop ) -> None :
568+ # 512KB + 1 byte
569+ too_large_content = "a" * (512 * 1024 + 1 )
570+ with pytest .raises (ValueError , match = r"exceeds maximum size" ):
571+ await async_client .blueprints .create (
572+ name = "name" ,
573+ file_mounts = {"/tmp/large.txt" : too_large_content },
574+ )
575+
576+ @parametrize
577+ async def test_create_rejects_total_file_mount_size (self , async_client : AsyncRunloop ) -> None :
578+ # Two files at exactly per-file max, plus 1 extra byte across a third file to exceed 1MB total
579+ per_file_max = 512 * 1024
580+ content_a = "a" * per_file_max
581+ content_b = "b" * per_file_max
582+ content_c = "c" * 1
583+ with pytest .raises (ValueError , match = r"total file_mounts size exceeds maximum" ):
584+ await async_client .blueprints .create (
585+ name = "name" ,
586+ file_mounts = {
587+ "/tmp/a.txt" : content_a ,
588+ "/tmp/b.txt" : content_b ,
589+ "/tmp/c.txt" : content_c ,
590+ },
591+ )
592+
539593 @parametrize
540594 async def test_method_retrieve (self , async_client : AsyncRunloop ) -> None :
541595 blueprint = await async_client .blueprints .retrieve (
0 commit comments