MCPcopy Index your code
hub / github.com/pyscript/pyscript / test_device_get_stream

Function test_device_get_stream

core/tests/python/tests/test_media.py:135–151  ·  view source on GitHub ↗

The get_stream instance method should return a stream from a specific device.

()

Source from the content-addressed store, hash-verified

133 skip_when=not upytest.is_micropython,
134)
135async def test_device_get_stream():
136 """
137 The get_stream instance method should return a stream from a specific
138 device.
139 """
140 try:
141 devices = await media.list_devices()
142
143 # Find a video input device to test with.
144 video_devices = [d for d in devices if d.kind == "videoinput"]
145
146 if video_devices:
147 stream = await video_devices[0].get_stream()
148 assert hasattr(stream, "active")
149 except Exception:
150 # Permission denied or no devices available - test passes.
151 pass
152
153
154async def test_device_filtering_by_kind():

Callers

nothing calls this directly

Calls 1

get_streamMethod · 0.80

Tested by

no test coverage detected