mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-06 05:52:12 +08:00
86b6103657
* test_*.py files are no longer executable * cleanup empty lines * update precommit * fixme * enable * build old-commit-hash: c59887c8109dd8d33ea2e7169995184fbe38cc3a
23 lines
432 B
Python
23 lines
432 B
Python
import pytest
|
|
import time
|
|
import numpy as np
|
|
|
|
from openpilot.system.hardware.tici.hardware import Tici
|
|
|
|
HARDWARE = Tici()
|
|
|
|
|
|
@pytest.mark.tici
|
|
class TestHardware:
|
|
|
|
def test_power_save_time(self):
|
|
ts = []
|
|
for _ in range(5):
|
|
for on in (True, False):
|
|
st = time.monotonic()
|
|
HARDWARE.set_power_save(on)
|
|
ts.append(time.monotonic() - st)
|
|
|
|
assert 0.1 < np.mean(ts) < 0.25
|
|
assert max(ts) < 0.3
|