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
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def test_invalid_token():
Test that an empty token raises an UnauthorizedException.
"""
with pytest.raises(UnauthorizedException):
async with Werk24Client(token="", region="eu-central-1") as client:
async with Werk24Client(token="", region="eu-central-1"):
...


Expand All @@ -90,5 +90,5 @@ async def test_invalid_region():
Test that an empty region raises an InvalidLicenseException.
"""
with pytest.raises(InvalidLicenseException):
async with Werk24Client(token="", region=None) as client:
async with Werk24Client(token="", region=None):
...
16 changes: 16 additions & 0 deletions werk24/models/v1/insert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from enum import Enum

from pydantic import BaseModel, Field


class W24InsertType(str, Enum):
ALIGNMENT = "ALIGNMENT"
SEALING = "SEALING"
THREAD = "THREAD"
WEAR = "WEAR"
WELDING = "WELDING"


class W24Insert(BaseModel):
blurb: str = Field(..., description="Descriptive name of the insert")
category: W24InsertType = Field(..., description="Category of the insert")
13 changes: 10 additions & 3 deletions werk24/models/v1/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .chamfer import W24Chamfer
from .depth import W24Depth
from .hole_feature import W24CounterBore, W24CounterDrill, W24CounterSink
from .insert import W24Insert
from .size import W24Size
from .test_dimension import W24TestDimension
from .thread import W24ThreadUnion
Expand Down Expand Up @@ -136,15 +137,16 @@ class W24MeasureLabel(BaseModel):

depth: Depth of the drilling or thread. Uses the same dimensions

counterbore: Counterbore details. This is usually defined for holes
counterbores: Counterbore details. This is usually defined for holes
threads.

countersink: Countersink details. This is usually defined for holes
countersinks: Countersink details. This is usually defined for holes
threads.

counterdrill: Counterdrill details. This is usually defined for holes
counterdrills: Counterdrill details. This is usually defined for holes
threads.

inserts: List of Inserts
"""

@field_validator("size_tolerance", mode="before")
Expand Down Expand Up @@ -185,6 +187,11 @@ def deserialize_size_tolerance(cls, v):

counterdrills: List[W24CounterDrill] = []

inserts: List[W24Insert] = Field(
default_factory=list,
description="List of Inserts (e.g., Press fit, Tapping Insert, Heat-Set Inserts etc.)",
)


class W24Measure(W24BaseFeatureModel):
"""Measure object
Expand Down
Loading