Skip to content

Commit

Permalink
Add return type to test
Browse files Browse the repository at this point in the history
to get type checking with mypy
  • Loading branch information
tsundvoll committed Dec 13, 2024
1 parent 03e367c commit 76b3283
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions tests/test_inspections.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
from alitra import Frame, Position
from robot_interface.models.mission.task import (
RecordAudio,
TakeImage,
TakeThermalVideo,
)
from robot_interface.models.mission.task import RecordAudio, TakeImage, TakeThermalVideo

from isar_robot import inspections

target = Position(x=0, y=0, z=0, frame=Frame("robot"))


def test_create_image():
def test_create_image() -> None:
task_actions = TakeImage(target=target)

inspection_image = inspections.create_image(task_actions)

assert inspection_image.metadata.file_type == "jpg"


def test_create_video():
def test_create_video() -> None:
task_actions = TakeImage(target=target)

inspection_video = inspections.create_video(task_actions)

assert inspection_video.metadata.file_type == "mp4"


def test_create_thermal_video():
def test_create_thermal_video() -> None:
task_actions = TakeThermalVideo(target=target, duration=10)

inspection_video = inspections.create_thermal_video(task_actions)
Expand All @@ -35,7 +31,7 @@ def test_create_thermal_video():
assert inspection_video.metadata.duration == 10


def test_create_audio():
def test_create_audio() -> None:
task_actions = RecordAudio(target=target, duration=10)

inspection_recording = inspections.create_audio(task_actions)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_telemetry.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from isar_robot.telemetry import _get_battery_level, _get_pressure_level


def test_get_battery_level():
def test_get_battery_level() -> None:
for _ in range(100):
pressure_level: float = _get_battery_level()
assert pressure_level >= 50
assert pressure_level <= 100


def test_get_pressure_level():
def test_get_pressure_level() -> None:
for _ in range(100):
pressure_level: float = _get_pressure_level()
assert pressure_level >= 0.011
Expand Down

0 comments on commit 76b3283

Please sign in to comment.