Add Python test harness for openCVHelp class (#1557)

This commit is contained in:
Lucien Morey
2024-11-15 03:10:08 +11:00
committed by GitHub
parent c04e13ef93
commit c50c657193
7 changed files with 450 additions and 12 deletions

View File

@@ -0,0 +1,36 @@
import pytest
from photonlibpy import Packet
from photonlibpy.targeting import PhotonPipelineResult
@pytest.fixture(autouse=True)
def setupCommon() -> None:
pass
def test_Empty() -> None:
packet = Packet(b"1")
PhotonPipelineResult()
packet.setData(bytes(0))
PhotonPipelineResult.photonStruct.unpack(packet)
# There is no need for an assert as we are checking
# if this throws an exception (it should not)
@pytest.mark.parametrize(
"robotStart, coprocStart, robotRestart, coprocRestart",
[
[1, 10, 30, 30],
[10, 2, 30, 30],
[10, 10, 30, 30],
# Reboot just the robot
[1, 1, 10, 30],
# Reboot just the coproc
[1, 1, 30, 10],
],
)
def test_RestartingRobotandCoproc(
robotStart: int, coprocStart: int, robotRestart: int, coprocRestart: int
):
# Python doesn't have a TimeSyncClient so we can't run this yet
pass