Skip to content

Commit

Permalink
Run formatters.
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed Dec 13, 2023
1 parent 7cf06a9 commit abb094d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ use device_manager::DeviceManager;
use pyo3::prelude::*;
use std::ffi::CStr;

use crate::runtime::{AvailableData, AvailableDataContext, VideoFrame, VideoFrameMetadata, VideoFrameTimestamps};
use crate::runtime::{
AvailableData, AvailableDataContext, VideoFrame, VideoFrameMetadata, VideoFrameTimestamps,
};

trait Status: Copy + Sized {
fn is_ok(&self) -> bool;
Expand Down
16 changes: 11 additions & 5 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ def test_zero_conf_start(runtime: Runtime):

def test_repeat_acq(runtime: Runtime):
p = acquire.setup(runtime, "simulated: radial sin", "Trash")
assert p.video[0].camera.identifier is not None, "Expected a camera identifier"
assert p.video[0].storage.identifier is not None, "Expected a storage identifier"
assert (
p.video[0].camera.identifier is not None
), "Expected a camera identifier"
assert (
p.video[0].storage.identifier is not None
), "Expected a storage identifier"
assert p.video[0].storage.settings.filename == "out.tif"
p.video[0].camera.settings.shape = (192, 108)
p.video[0].max_frame_count = 10
Expand All @@ -96,7 +100,7 @@ def test_repeat_acq(runtime: Runtime):
logging.info(f"Got {a.get_frame_count()}")
break
if a:
assert a.get_frame_count()==0
assert a.get_frame_count() == 0
assert next(a.frames()) is None
runtime.stop()
# TODO: (nclack) assert 1 acquired frame. stop should block
Expand All @@ -107,7 +111,7 @@ def test_repeat_acq(runtime: Runtime):
logging.info(f"Got {a.get_frame_count()}")
break
if a:
assert a.get_frame_count()==0
assert a.get_frame_count() == 0
assert next(a.frames()) is None
runtime.stop()
# TODO: (nclack) assert 1 more acquired frame. stop cancels and waits.
Expand Down Expand Up @@ -320,7 +324,9 @@ def is_not_done() -> bool:
n = packet.get_frame_count()
for i, frame in enumerate(packet.frames()):
expected_frame_id = nframes[stream_id] + i
assert frame.metadata().frame_id == expected_frame_id, (
assert (
frame.metadata().frame_id == expected_frame_id
), (
"frame id's didn't match "
+ f"({frame.metadata().frame_id}!={expected_frame_id})"
+ f" [stream {stream_id} nframes {nframes}]"
Expand Down

0 comments on commit abb094d

Please sign in to comment.