MCPcopy Create free account
hub / github.com/e2b-dev/desktop / test_screenshot

Function test_screenshot

packages/python-sdk/tests/test_controls.py:48–57  ·  view source on GitHub ↗
(sandbox: Sandbox)

Source from the content-addressed store, hash-verified

46
47
48def test_screenshot(sandbox: Sandbox):
49 image = sandbox.screenshot()
50 assert image, "Screenshot was not taken successfully"
51
52 # Check if the image is a valid image format
53 try:
54 img = Image.open(io.BytesIO(image))
55 img.verify() # Verify that it is an image
56 except Exception:
57 assert False, "The screenshot is not a valid image."
58
59
60def test_get_cursor_position(sandbox: Sandbox):

Callers

nothing calls this directly

Calls 2

screenshotMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected