File tree Expand file tree Collapse file tree 2 files changed +21
-28
lines changed Expand file tree Collapse file tree 2 files changed +21
-28
lines changed Original file line number Diff line number Diff line change
1
+ import temporalio .nexus ._link_conversion
2
+
3
+
4
+ def test_link_conversion_utilities ():
5
+ p2c = temporalio .nexus ._link_conversion ._event_type_pascal_case_to_constant_case
6
+ c2p = temporalio .nexus ._link_conversion ._event_type_constant_case_to_pascal_case
7
+
8
+ for p , c in [
9
+ ("" , "" ),
10
+ ("A" , "A" ),
11
+ ("Ab" , "AB" ),
12
+ ("AbCd" , "AB_CD" ),
13
+ ("AbCddE" , "AB_CDD_E" ),
14
+ ("ContainsAOneLetterWord" , "CONTAINS_A_ONE_LETTER_WORD" ),
15
+ ("NexusOperationScheduled" , "NEXUS_OPERATION_SCHEDULED" ),
16
+ ]:
17
+ assert p2c (p ) == c
18
+ assert c2p (c ) == p
19
+
20
+ assert p2c ("a" ) == "A"
21
+ assert c2p ("A" ) == "A"
Original file line number Diff line number Diff line change 23
23
from nexusrpc .handler ._decorators import operation_handler
24
24
25
25
import temporalio .api
26
- import temporalio .api .common
27
- import temporalio .api .common .v1
28
26
import temporalio .api .enums .v1
29
- import temporalio .api .nexus
30
- import temporalio .api .nexus .v1
31
- import temporalio .api .operatorservice
32
- import temporalio .api .operatorservice .v1
33
- import temporalio .exceptions
34
- import temporalio .nexus ._link_conversion
35
27
import temporalio .nexus ._operation_handlers
36
28
from temporalio import nexus , workflow
37
29
from temporalio .client import (
@@ -1347,23 +1339,3 @@ async def test_workflow_run_operation_overloads(
1347
1339
if op != "no_param"
1348
1340
else OverloadTestValue (value = 0 )
1349
1341
)
1350
-
1351
-
1352
- def test_link_conversion_utilities ():
1353
- p2c = temporalio .nexus ._link_conversion ._event_type_pascal_case_to_constant_case
1354
- c2p = temporalio .nexus ._link_conversion ._event_type_constant_case_to_pascal_case
1355
-
1356
- for p , c in [
1357
- ("" , "" ),
1358
- ("A" , "A" ),
1359
- ("Ab" , "AB" ),
1360
- ("AbCd" , "AB_CD" ),
1361
- ("AbCddE" , "AB_CDD_E" ),
1362
- ("ContainsAOneLetterWord" , "CONTAINS_A_ONE_LETTER_WORD" ),
1363
- ("NexusOperationScheduled" , "NEXUS_OPERATION_SCHEDULED" ),
1364
- ]:
1365
- assert p2c (p ) == c
1366
- assert c2p (c ) == p
1367
-
1368
- assert p2c ("a" ) == "A"
1369
- assert c2p ("A" ) == "A"
You can’t perform that action at this time.
0 commit comments