forked from ControlCore-Project/concore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_phase1_cases.json
More file actions
142 lines (142 loc) · 3.5 KB
/
Copy pathpython_phase1_cases.json
File metadata and controls
142 lines (142 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
"schema_version": "1.0",
"runtime": "python",
"mode": "report_only",
"cases": [
{
"id": "parse_params/simple_types_and_whitespace",
"target": "parse_params",
"description": "Semicolon-delimited params preserve string values and coerce literals.",
"input": {
"sparams": "delay=5; coeffs=[1,2,3]; label = hello world"
},
"expected": {
"result": {
"delay": 5,
"coeffs": [
1,
2,
3
],
"label": "hello world"
}
}
},
{
"id": "parse_params/embedded_equals_not_split",
"target": "parse_params",
"description": "Only the first '=' is used as key/value separator.",
"input": {
"sparams": "url=https://example.com?a=1&b=2"
},
"expected": {
"result": {
"url": "https://example.com?a=1&b=2"
}
}
},
{
"id": "initval/valid_list_sets_simtime",
"target": "initval",
"description": "initval sets simtime to first numeric entry and returns payload tail.",
"input": {
"initial_simtime": 0,
"simtime_val_str": "[12.5, \"a\", 3]"
},
"expected": {
"result": [
"a",
3
],
"simtime_after": 12.5
}
},
{
"id": "initval/invalid_input_returns_empty_and_preserves_simtime",
"target": "initval",
"description": "Invalid non-list input returns [] and leaves simtime unchanged.",
"input": {
"initial_simtime": 7,
"simtime_val_str": "not_a_list"
},
"expected": {
"result": [],
"simtime_after": 7
}
},
{
"id": "write_zmq/list_payload_prepends_timestamp_without_mutation",
"target": "write_zmq",
"description": "write() prepends simtime+delta for list payloads but does not mutate global simtime.",
"input": {
"initial_simtime": 10,
"delta": 2,
"name": "data",
"value": [
1.5,
2.5
]
},
"expected": {
"sent_payload": [
12,
1.5,
2.5
],
"simtime_after": 10
}
},
{
"id": "write_zmq/non_list_payload_forwarded_as_is",
"target": "write_zmq",
"description": "Non-list payloads are forwarded as-is and simtime remains unchanged.",
"input": {
"initial_simtime": 10,
"delta": 3,
"name": "status",
"value": "ok"
},
"expected": {
"sent_payload": "ok",
"simtime_after": 10
}
},
{
"id": "read_file/missing_file_returns_default_and_false",
"target": "read_file",
"description": "read() returns init default with ok=False when file is missing.",
"input": {
"initial_simtime": 4,
"port": 1,
"name": "missing",
"initstr_val": "[0.0, 5.0]"
},
"expected": {
"result": [
5.0
],
"ok": false,
"simtime_after": 4
}
},
{
"id": "read_file/older_timestamp_does_not_decrease_simtime",
"target": "read_file",
"description": "read() keeps simtime monotonic when incoming file timestamp is older.",
"input": {
"initial_simtime": 10,
"port": 1,
"name": "ym",
"file_content": "[7.0, 3.14]",
"initstr_val": "[0.0, 0.0]"
},
"expected": {
"result": [
3.14
],
"ok": true,
"simtime_after": 10
}
}
]
}