File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import pytest
66from 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-
4023class TestUnit :
4124 """Unit tests for Unit model - tests properties and methods."""
4225
Original file line number Diff line number Diff line change 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
193193if "pytest" in sys .modules :
194194 # These are not test classes, so we need to set __test__ to False to avoid pytest warnings.
259259 "TestStepCreate" ,
260260 "TestStepType" ,
261261 "Unit" ,
262- "UnitCreate" ,
263262]
Original file line number Diff line number Diff line change 22
33from typing import TYPE_CHECKING
44
5- from sift .unit .v2 .unit_pb2 import CreateUnitRequest as CreateUnitRequestProto
65from 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
139if 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-
2613class Unit (BaseType [UnitProto , "Unit" ]):
2714 """Model of the Sift Unit."""
2815
You can’t perform that action at this time.
0 commit comments