def test_already_closed(): dev = MpDevice(Dummy()) dev.start() res = dev.read() dev.stop() with raises(RuntimeError): dev.read()
def test_device_single(): dev = MpDevice(Dummy()) dev.start() sleep(0.25) res = dev.read() dev.stop() assert (res is not None) time, data = res print(np.diff(time)) print(data.shape) assert (data.shape[0] > 10) assert (data.shape[0] == time.shape[0])
def test_start_start(): dev = MpDevice(Dummy()) dev.start() with raises(RuntimeError): dev.start() dev.stop()