Skip to content

Commit 9b47532

Browse files
committed
drop unused UnitCreate model
1 parent aa33323 commit 9b47532

3 files changed

Lines changed: 3 additions & 34 deletions

File tree

python/lib/sift_client/_tests/sift_types/test_unit.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66
from sift.unit.v2.unit_pb2 import Unit as UnitProto
77

8-
from sift_client.sift_types.unit import Unit, UnitCreate
8+
from sift_client.sift_types.unit import Unit
99

1010

1111
@pytest.fixture
@@ -20,23 +20,6 @@ def mock_unit(mock_client):
2020
return unit
2121

2222

23-
class TestUnitCreate:
24-
"""Unit tests for UnitCreate model."""
25-
26-
def test_unit_create_basic(self):
27-
"""Test basic UnitCreate instantiation."""
28-
create = UnitCreate(name="volts")
29-
30-
assert create.name == "volts"
31-
32-
def test_unit_create_to_proto(self):
33-
"""Test that UnitCreate converts to a CreateUnitRequest proto correctly."""
34-
create = UnitCreate(name="volts")
35-
proto = create.to_proto()
36-
37-
assert proto.name == "volts"
38-
39-
4023
class TestUnit:
4124
"""Unit tests for Unit model - tests properties and methods."""
4225

python/lib/sift_client/sift_types/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
TestStepCreate,
189189
TestStepType,
190190
)
191-
from sift_client.sift_types.unit import Unit, UnitCreate
191+
from sift_client.sift_types.unit import Unit
192192

193193
if "pytest" in sys.modules:
194194
# These are not test classes, so we need to set __test__ to False to avoid pytest warnings.
@@ -259,5 +259,4 @@
259259
"TestStepCreate",
260260
"TestStepType",
261261
"Unit",
262-
"UnitCreate",
263262
]

python/lib/sift_client/sift_types/unit.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,14 @@
22

33
from typing import TYPE_CHECKING
44

5-
from sift.unit.v2.unit_pb2 import CreateUnitRequest as CreateUnitRequestProto
65
from sift.unit.v2.unit_pb2 import Unit as UnitProto
76

8-
from sift_client.sift_types._base import (
9-
BaseType,
10-
ModelCreate,
11-
)
7+
from sift_client.sift_types._base import BaseType
128

139
if TYPE_CHECKING:
1410
from sift_client.client import SiftClient
1511

1612

17-
class UnitCreate(ModelCreate[CreateUnitRequestProto]):
18-
"""Create model for Unit."""
19-
20-
name: str
21-
22-
def _get_proto_class(self) -> type[CreateUnitRequestProto]:
23-
return CreateUnitRequestProto
24-
25-
2613
class Unit(BaseType[UnitProto, "Unit"]):
2714
"""Model of the Sift Unit."""
2815

0 commit comments

Comments
 (0)