66当前文件为自动生成的控制 API 客户端代码。请勿手动修改此文件。
77使用 `make codegen` 命令重新生成。
88
9- source: tests/e2e/__test_sandbox_browser_async_template.py
9+ source: .claude/worktrees/infallible-pasteur-94186e/ tests/e2e/__test_sandbox_browser_async_template.py
1010
1111
1212Sandbox Browser 模块的 E2E 测试
@@ -77,7 +77,9 @@ async def test_create_browser_sandbox_async(
7777 finally :
7878 await sb .delete_async ()
7979
80- def test_create_browser_sandbox (self , browser_template : Template ):
80+ def test_create_browser_sandbox (
81+ self , browser_template : Template
82+ ):
8183 """测试创建 Browser Sandbox"""
8284 sb = Sandbox .create (
8385 template_type = TemplateType .BROWSER ,
@@ -251,7 +253,9 @@ async def test_playwright_async_navigation_async(
251253 finally :
252254 await sb .delete_async ()
253255
254- def test_playwright_navigation (self , browser_template : Template ):
256+ def test_playwright_navigation (
257+ self , browser_template : Template
258+ ):
255259 """测试 Playwright 同步导航功能"""
256260 sb = Sandbox .create (
257261 template_type = TemplateType .BROWSER ,
@@ -328,7 +332,9 @@ async def test_playwright_async_screenshot_async(
328332 if os .path .exists (screenshot_path ):
329333 os .remove (screenshot_path )
330334
331- def test_playwright_screenshot (self , browser_template : Template ):
335+ def test_playwright_screenshot (
336+ self , browser_template : Template
337+ ):
332338 """测试 Playwright 同步截图功能"""
333339 sb = Sandbox .create (
334340 template_type = TemplateType .BROWSER ,
@@ -410,7 +416,9 @@ async def test_playwright_async_search_async(
410416 finally :
411417 await sb .delete_async ()
412418
413- def test_playwright_search (self , browser_template : Template ):
419+ def test_playwright_search (
420+ self , browser_template : Template
421+ ):
414422 """测试 Playwright 同步搜索功能"""
415423 sb = Sandbox .create (
416424 template_type = TemplateType .BROWSER ,
@@ -507,7 +515,9 @@ async def test_playwright_async_multiple_pages_async(
507515 finally :
508516 await sb .delete_async ()
509517
510- def test_playwright_multiple_pages (self , browser_template : Template ):
518+ def test_playwright_multiple_pages (
519+ self , browser_template : Template
520+ ):
511521 """测试 Playwright 同步多页面跳转"""
512522 sb = Sandbox .create (
513523 template_type = TemplateType .BROWSER ,
@@ -544,13 +554,17 @@ def test_playwright_multiple_pages(self, browser_template: Template):
544554 # 后退
545555 playwright .go_back ()
546556 time .sleep (1 )
547- url_after_back = playwright .evaluate ("window.location.href" )
557+ url_after_back = playwright .evaluate (
558+ "window.location.href"
559+ )
548560 assert "baidu.com" in url_after_back
549561
550562 # 前进
551563 playwright .go_forward ()
552564 time .sleep (1 )
553- url_after_forward = playwright .evaluate ("window.location.href" )
565+ url_after_forward = playwright .evaluate (
566+ "window.location.href"
567+ )
554568 assert "aliyun.com" in url_after_forward
555569 finally :
556570 sb .delete ()
@@ -886,7 +900,9 @@ async def test_browser_concurrent_operations_async(
886900 for sb in sandboxes :
887901 await sb .delete_async ()
888902
889- def test_browser_concurrent_operations (self , browser_template : Template ):
903+ def test_browser_concurrent_operations (
904+ self , browser_template : Template
905+ ):
890906 """测试并发创建多个浏览器 Sandbox"""
891907 num_sandboxes = 2
892908 sandboxes = []
@@ -901,7 +917,7 @@ def test_browser_concurrent_operations(self, browser_template: Template):
901917 )
902918 for _ in range (num_sandboxes )
903919 ]
904- sandboxes = create_tasks
920+ sandboxes = ( create_tasks )
905921
906922 # 验证所有 Sandbox 都创建成功
907923 assert len (sandboxes ) == num_sandboxes
0 commit comments