Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

setup(
name="tofupilot",
version="1.9.4",
version="1.10.0",
packages=find_packages(),
install_requires=["requests", "setuptools", "packaging", "pytest", "websockets"],
entry_points={
"pytest11": [
"tofupilot = tofupilot.plugin", # Registering the pytest plugin
],
},
author="Félix Berthier",
author_email="felix.berthier@tofupilot.com",
author="TofuPilot",
author_email="hello@tofupilot.com",
description="The official Python client for the TofuPilot API",
license="MIT",
keywords="automatic hardware testing tofupilot",
Expand Down
6 changes: 5 additions & 1 deletion tofupilot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
CLIENT_MAX_ATTACHMENTS,
SECONDS_BEFORE_TIMEOUT,
)
from .models import SubUnit, UnitUnderTest, Step, Phase
from .models import SubUnit, UnitUnderTest, Step, Phase, Log
from .utils import (
check_latest_version,
validate_files,
Expand Down Expand Up @@ -76,6 +76,7 @@ def create_run( # pylint: disable=too-many-arguments,too-many-locals
sub_units: Optional[List[SubUnit]] = None,
report_variables: Optional[Dict[str, str]] = None,
attachments: Optional[List[str]] = None,
logs: Optional[List[Log]] = None,
) -> dict:
"""
Creates a test run with the specified parameters and uploads it to the TofuPilot platform.
Expand Down Expand Up @@ -139,6 +140,9 @@ def create_run( # pylint: disable=too-many-arguments,too-many-locals
if phases is not None:
payload["phases"] = phases

if logs is not None:
payload["logs"] = logs

if started_at is not None:
payload["started_at"] = datetime_to_iso(started_at)

Expand Down
2 changes: 2 additions & 0 deletions tofupilot/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Phase,
MeasurementOutcome,
PhaseOutcome,
Log,
)

__all__ = [
Expand All @@ -14,4 +15,5 @@
"Phase",
"MeasurementOutcome",
"PhaseOutcome",
"Log",
]
16 changes: 16 additions & 0 deletions tofupilot/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ class Phase(TypedDict):
docstring: Optional[str]


class LogLevel(str, Enum):
DEBUG = "DEBUG"
INFO = "INFO"
WARNING = "WARNING"
ERROR = "ERROR"
CRITICAL = " CRITICAL"


class Log(TypedDict):
level: LogLevel
timestamp: int
message: str
source_file: str
line_number: int


class SubUnit(TypedDict):
serial_number: str

Expand Down
Loading