|
@@ -262,15 +262,16 @@ class SrcFixedPDOTestCase(unittest.TestCase):
|
262
|
262
|
|
263
|
263
|
def setUp(self):
|
264
|
264
|
self.obj_everything = pdbuddy.SrcFixedPDO(True, True, True, True, True,
|
265
|
|
- 3, 20000, 5000)
|
|
265
|
+ True, 3, 20000, 5000)
|
266
|
266
|
self.obj_minimal = pdbuddy.SrcFixedPDO(False, False, False, False,
|
267
|
|
- False, 0, 5000, 1500)
|
|
267
|
+ False, False, 0, 5000, 1500)
|
268
|
268
|
|
269
|
269
|
def test_str_everything(self):
|
270
|
270
|
self.assertEqual(str(self.obj_everything),
|
271
|
271
|
"fixed\n\tdual_role_pwr: 1\n\tusb_suspend: 1\n"
|
272
|
272
|
"\tunconstrained_pwr: 1\n\tusb_comms: 1\n\tdual_role_data: 1\n"
|
273
|
|
- "\tpeak_i: 3\n\tv: 20.00 V\n\ti: 5.00 A")
|
|
273
|
+ "\tunchunked_ext_msg: 1\n\tpeak_i: 3\n\tv: 20.00 V\n"
|
|
274
|
+ "\ti: 5.00 A")
|
274
|
275
|
|
275
|
276
|
def test_str_minimal(self):
|
276
|
277
|
self.assertEqual(str(self.obj_minimal),
|
|
@@ -290,9 +291,9 @@ class ReadPDOTestCase(unittest.TestCase):
|
290
|
291
|
|
291
|
292
|
def setUp(self):
|
292
|
293
|
self.src_fixed_everything = pdbuddy.SrcFixedPDO(True, True, True, True,
|
293
|
|
- True, 3, 20000, 5000)
|
|
294
|
+ True, True, 3, 20000, 5000)
|
294
|
295
|
self.src_fixed_minimal = pdbuddy.SrcFixedPDO(False, False, False,
|
295
|
|
- False, False, 0, 5000, 1500)
|
|
296
|
+ False, False, False, 0, 5000, 1500)
|
296
|
297
|
self.unknown_zero = pdbuddy.UnknownPDO(value=0x00000000)
|
297
|
298
|
self.unknown_notzero = pdbuddy.UnknownPDO(value=0xFFFFFFFF)
|
298
|
299
|
self.typec_virtual = pdbuddy.TypeCVirtualPDO(1500)
|
|
@@ -304,6 +305,7 @@ class ReadPDOTestCase(unittest.TestCase):
|
304
|
305
|
b"\tunconstrained_pwr: 1",
|
305
|
306
|
b"\tusb_comms: 1",
|
306
|
307
|
b"\tdual_role_data: 1",
|
|
308
|
+ b"\tunchunked_ext_msg: 1",
|
307
|
309
|
b"\tpeak_i: 3",
|
308
|
310
|
b"\tv: 20.00 V",
|
309
|
311
|
b"\ti: 5.00 A"])
|
|
@@ -343,9 +345,9 @@ class ReadPDOListTestCase(unittest.TestCase):
|
343
|
345
|
|
344
|
346
|
def setUp(self):
|
345
|
347
|
self.src_fixed_everything = pdbuddy.SrcFixedPDO(True, True, True, True,
|
346
|
|
- True, 3, 20000, 5000)
|
|
348
|
+ True, True, 3, 20000, 5000)
|
347
|
349
|
self.src_fixed_minimal = pdbuddy.SrcFixedPDO(False, False, False,
|
348
|
|
- False, False, 0, 5000, 1500)
|
|
350
|
+ False, False, False, 0, 5000, 1500)
|
349
|
351
|
self.unknown_zero = pdbuddy.UnknownPDO(value=0x00000000)
|
350
|
352
|
self.unknown_notzero = pdbuddy.UnknownPDO(value=0xFFFFFFFF)
|
351
|
353
|
self.typec_virtual = pdbuddy.TypeCVirtualPDO(1500)
|
|
@@ -359,6 +361,7 @@ class ReadPDOListTestCase(unittest.TestCase):
|
359
|
361
|
b"\tunconstrained_pwr: 1",
|
360
|
362
|
b"\tusb_comms: 1",
|
361
|
363
|
b"\tdual_role_data: 1",
|
|
364
|
+ b"\tunchunked_ext_msg: 1",
|
362
|
365
|
b"\tpeak_i: 3",
|
363
|
366
|
b"\tv: 20.00 V",
|
364
|
367
|
b"\ti: 5.00 A",
|
|
@@ -382,25 +385,25 @@ class PDOListCalculationsTestCase(unittest.TestCase):
|
382
|
385
|
|
383
|
386
|
def setUp(self):
|
384
|
387
|
self.src_fixed_5v_1p5a = pdbuddy.SrcFixedPDO(False, False, True,
|
385
|
|
- False, False, 0, 5000, 1500)
|
|
388
|
+ False, False, False, 0, 5000, 1500)
|
386
|
389
|
self.src_fixed_5v_3a = pdbuddy.SrcFixedPDO(False, False, True, False,
|
387
|
|
- False, 0, 5000, 3000)
|
|
390
|
+ False, False, 0, 5000, 3000)
|
388
|
391
|
self.src_fixed_9v_1p6a = pdbuddy.SrcFixedPDO(False, False, False,
|
389
|
|
- False, False, 0, 9000, 1600)
|
|
392
|
+ False, False, False, 0, 9000, 1600)
|
390
|
393
|
self.src_fixed_9v_3a = pdbuddy.SrcFixedPDO(False, False, False, False,
|
391
|
|
- False, 0, 9000, 3000)
|
|
394
|
+ False, False, 0, 9000, 3000)
|
392
|
395
|
self.src_fixed_10v_1p5a = pdbuddy.SrcFixedPDO(False, False, False,
|
393
|
|
- False, False, 0, 10000, 1500)
|
|
396
|
+ False, False, False, 0, 10000, 1500)
|
394
|
397
|
self.src_fixed_12v_5a = pdbuddy.SrcFixedPDO(False, False, False, False,
|
395
|
|
- False, 0, 12000, 5000)
|
|
398
|
+ False, False, 0, 12000, 5000)
|
396
|
399
|
self.src_fixed_15v_1p8a = pdbuddy.SrcFixedPDO(False, False, False,
|
397
|
|
- False, False, 0, 15000, 1800)
|
|
400
|
+ False, False, False, 0, 15000, 1800)
|
398
|
401
|
self.src_fixed_15v_3a = pdbuddy.SrcFixedPDO(False, False, False, False,
|
399
|
|
- False, 0, 15000, 3000)
|
|
402
|
+ False, False, 0, 15000, 3000)
|
400
|
403
|
self.src_fixed_20v_2p25a = pdbuddy.SrcFixedPDO(False, False, False,
|
401
|
|
- False, False, 0, 20000, 2250)
|
|
404
|
+ False, False, False, 0, 20000, 2250)
|
402
|
405
|
self.src_fixed_20v_5a = pdbuddy.SrcFixedPDO(False, False, False, False,
|
403
|
|
- False, 0, 20000, 5000)
|
|
406
|
+ False, False, 0, 20000, 5000)
|
404
|
407
|
self.typec_virtual_1p5a = pdbuddy.TypeCVirtualPDO(1500)
|
405
|
408
|
|
406
|
409
|
def test_calculate_pdp_typec_virtual(self):
|