File: test_vehicle.ambr

package info (click to toggle)
python-renault-api 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,696 kB
  • sloc: python: 7,804; makefile: 2
file content (350 lines) | stat: -rw-r--r-- 13,272 bytes parent folder | download
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# serializer version: 1
# name: test_http_get
  '''
  {'data': {'type': 'Car', 'id': 'VF1AAAAA555777999', 'attributes': {'mode': 'scheduled', 'schedules': [{'id': 1, 'activated': True, 'monday': {'startTime': 'T12:00Z', 'duration': 15}, 'tuesday': {'startTime': 'T04:30Z', 'duration': 420}, 'wednesday': {'startTime': 'T22:30Z', 'duration': 420}, 'thursday': {'startTime': 'T22:00Z', 'duration': 420}, 'friday': {'startTime': 'T12:15Z', 'duration': 15}, 'saturday': {'startTime': 'T12:30Z', 'duration': 30}, 'sunday': {'startTime': 'T12:45Z', 'duration': 45}}]}}}
  
  '''
# ---
# name: test_http_get_list
  '''
  {'data': [{'notificationId': 'ffcb0310-503f-4bc3-9056-e9d051a089c6', 'notifDate': '2022-02-01T19:01:51.622', 'vin': '*PRIVATE*', 'personId': '*PRIVATE*', 'kmrUserId': '*PRIVATE*', 'actionType': 'COMMAND_RESPONSE', 'commandResponse': {'status': 'CREATED'}, 'commandType': 'SRP_SETS'}, {'notificationId': 'ffcb0310-503f-4bc3-9056-e9d051a089c6', 'notifDate': '2022-02-01T19:01:51.623', 'vin': '*PRIVATE*', 'personId': '*PRIVATE*', 'kmrUserId': '*PRIVATE*', 'actionType': 'SRP_SALT_REQUEST', 'srpResponse': {'status': 'OK', 'loginB': '*PRIVATE*', 'loginSalt': '*PRIVATE*'}}]}
  
  '''
# ---
# name: test_http_post
  '''
  {'data': {'type': 'ChargeSchedule', 'id': 'guid', 'attributes': {'schedules': [{'id': 1, 'activated': True, 'tuesday': {'startTime': 'T04:30Z', 'duration': 420}, 'wednesday': {'startTime': 'T22:30Z', 'duration': 420}, 'thursday': {'startTime': 'T22:00Z', 'duration': 420}, 'friday': {'startTime': 'T23:30Z', 'duration': 480}, 'saturday': {'startTime': 'T18:30Z', 'duration': 120}, 'sunday': {'startTime': 'T12:45Z', 'duration': 45}}]}}}
  
  '''
# ---
# name: test_http_post.1
  dict({
    'data': dict({
      'attributes': dict({
        'schedules': list([
        ]),
      }),
      'type': 'ChargeSchedule',
    }),
  })
# ---
# name: test_http_post_file
  '''
  {'data': {'type': 'ChargeSchedule', 'id': 'guid', 'attributes': {'schedules': [{'id': 1, 'activated': True, 'tuesday': {'startTime': 'T04:30Z', 'duration': 420}, 'wednesday': {'startTime': 'T22:30Z', 'duration': 420}, 'thursday': {'startTime': 'T22:00Z', 'duration': 420}, 'friday': {'startTime': 'T23:30Z', 'duration': 480}, 'saturday': {'startTime': 'T18:30Z', 'duration': 120}, 'sunday': {'startTime': 'T12:45Z', 'duration': 45}}]}}}
  
  '''
# ---
# name: test_http_post_file.1
  dict({
    'data': dict({
      'attributes': dict({
        'schedules': list([
        ]),
      }),
      'type': 'ChargeSchedule',
    }),
  })
# ---
# name: test_vehicle_contracts
  '''
  Type                            Code                  Description                       Start       End         Status
  ------------------------------  --------------------  --------------------------------  ----------  ----------  ------------------
  WARRANTY_MAINTENANCE_CONTRACTS  40                    CONTRAT LOSANGE                   2018-04-04  2022-04-03  Actif
  CONNECTED_SERVICES              ZECONNECTP            My Z.E. Connect en série 36 mois  2018-08-23  2021-08-23  Actif
  CONNECTED_SERVICES              GBA                   Battery Services                  2018-03-23              Echec d’activation
  WARRANTY                        ManufacturerWarranty  Garantie fabricant                            2020-04-03  Expiré
  WARRANTY                        PaintingWarranty      Garantie peinture                             2021-04-03  Actif
  WARRANTY                        CorrosionWarranty     Garantie corrosion                            2030-04-03  Actif
  WARRANTY                        GMPeWarranty          Garantie GMPe                                 2020-04-03  Expiré
  WARRANTY                        AssistanceWarranty    Garantie assistance                           2020-04-03  Expiré
  
  '''
# ---
# name: test_vehicle_details
  '''
  Registration    Brand    Model    VIN
  --------------  -------  -------  -----------------
  REG-NUMBER      RENAULT  ZOE      VF1AAAAA555777999
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/austral_XHN1SU.1.json]
  '''
  ----------------  -------------------
  Total mileage     49114.27 km
  GPS Latitude      48.1234567
  GPS Longitude     11.1234567
  GPS last updated  2020-02-18 17:58:38
  ----------------  -------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/captur_ii.1.json]
  '''
  --------------------  -------------------
  Total mileage         5566.78 km
  Fuel autonomy         35.0 km
  Fuel quantity         3.0 L
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/captur_ii.2.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Total mileage         5566.78 km
  Fuel autonomy         35.0 km
  Fuel quantity         3.0 L
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/clio_v.1.json]
  '''
  ----------------  -------------------
  Total mileage     49114.27 km
  GPS Latitude      48.1234567
  GPS Longitude     11.1234567
  GPS last updated  2020-02-18 17:58:38
  ----------------  -------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/duster.1.json]
  '''
  --------------------  ----------------------
  Total mileage         49114.27 km
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  Lock status           locked
  Lock last updated     2022-02-02 14:51:13
  Engine state          Stopped, ready for RES
  HVAC status           off
  External temperature  8.0 °C
  Front left pressure   2460 bar
  Front right pressure  2730 bar
  Rear left pressure    2790 bar
  Rear right pressure   2790 bar
  --------------------  ----------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/megane_e-tech.1.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Total mileage         49114.27 km
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/megane_e-tech.2.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Total mileage         49114.27 km
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/renault_5.1.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Total mileage         49114.27 km
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/spring.1.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Total mileage         49114.27 km
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/twingo_ze.1.json]
  '''
  ----------------  -------------------------
  Battery level     50 %
  Last updated      2020-11-17 09:06:48
  Range estimate    128 km
  Plug state        PlugState.UNPLUGGED
  Charging state    ChargeState.NOT_IN_CHARGE
  Total mileage     49114.27 km
  GPS Latitude      48.1234567
  GPS Longitude     11.1234567
  GPS last updated  2020-02-18 17:58:38
  HVAC status       on
  ----------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/zoe_40.1.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Charge mode           always
  Total mileage         49114.27 km
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/zoe_40.2.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Charge mode           always
  Total mileage         49114.27 km
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status[tests/fixtures/kamereon/vehicles/zoe_50.1.json]
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Total mileage         5785.75 km
  Fuel autonomy         0.0 km
  Fuel quantity         0.0 L
  GPS Latitude          48.1234567
  GPS Longitude         11.1234567
  GPS last updated      2020-02-18 17:58:38
  HVAC status           on
  Front left pressure   2460 bar
  Front right pressure  2730 bar
  Rear left pressure    2790 bar
  Rear right pressure   2790 bar
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status_json
  '''
  {"battery-status": {"timestamp": "2020-11-17T09:06:48+01:00", "batteryLevel": 50, "batteryAutonomy": 128, "batteryCapacity": 0, "batteryAvailableEnergy": 0, "plugStatus": 0, "chargingStatus": -1.0}, "charge-mode": {"chargeMode": "always"}, "cockpit": {"totalMileage": 49114.27}, "hvac-status": {"externalTemperature": 8.0, "hvacStatus": "off"}}
  
  '''
# ---
# name: test_vehicle_status_no_prompt
  '''
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Charge mode           always
  Total mileage         49114.27 km
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---
# name: test_vehicle_status_prompt
  '''
  Please select a locale [fr_CA]: fr_FR
  Do you want to save the locale to the credential store? [y/N]: N
  
  User: test@example.com
  Password: 
  
      ID            Type         Vehicles
  --  ------------  ---------  ----------
   1  account-id-1  MYRENAULT           1
   2  account-id-2  SFDC                1
  
  Please select account [1]: 1
  Do you want to save the account ID to the credential store? [y/N]: y
  
      Vin                Registration    Brand    Model
  --  -----------------  --------------  -------  -------
   1  VF1AAAAA555777999  REG-NUMBER      RENAULT  ZOE
  
  Please select vehicle [1]: 1
  Do you want to save the VIN to the credential store? [y/N]: y
  
  --------------------  -------------------------
  Battery level         50 %
  Last updated          2020-11-17 09:06:48
  Range estimate        128 km
  Plug state            PlugState.UNPLUGGED
  Charging state        ChargeState.NOT_IN_CHARGE
  Charge mode           always
  Total mileage         49114.27 km
  HVAC status           off
  External temperature  8.0 °C
  --------------------  -------------------------
  
  '''
# ---