Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import logging
import os
import time
from datetime import timedelta
from time import sleep
Expand Down Expand Up @@ -616,7 +617,29 @@ def test_invalidated_frame(runtime: Runtime):
runtime.stop()


# FIXME: (nclack) awkwardness around references (available frames, f)
def test_switch_device_identifier(
runtime: Runtime, request: pytest.FixtureRequest
):
p = acquire.setup(runtime, "simulated.*empty", "trash")
assert p.video[0].storage.identifier.name == "trash"
p = runtime.set_configuration(p)

dm = runtime.device_manager()
p.video[0].storage.identifier = dm.select(DeviceKind.Storage, "tiff")
p.video[0].storage.settings.filename = f"{request.node.name}.tif"
p = runtime.set_configuration(p)
assert p.video[0].storage.identifier.name == "tiff"

runtime.start()
runtime.stop()

# will raise an exception if the file doesn't exist or is invalid
with tifffile.TiffFile(p.video[0].storage.settings.filename):
pass

# cleanup
os.remove(p.video[0].storage.settings.filename)


# NOTES:
#
Expand Down