|
@@ -397,10 +397,10 @@ class SrcFixedPDOTestCase(unittest.TestCase):
|
397
|
397
|
"fixed\n\tv: 5.00 V\n\ti: 1.50 A")
|
398
|
398
|
|
399
|
399
|
|
400
|
|
-class SourcePPSAPDOTestCase(unittest.TestCase):
|
|
400
|
+class SrcPPSAPDOTestCase(unittest.TestCase):
|
401
|
401
|
|
402
|
402
|
def setUp(self):
|
403
|
|
- self.obj_15v = pdbuddy.SourcePPSAPDO(3000, 16000, 3000)
|
|
403
|
+ self.obj_15v = pdbuddy.SrcPPSAPDO(3000, 16000, 3000)
|
404
|
404
|
|
405
|
405
|
def test_str_15v(self):
|
406
|
406
|
self.assertEqual(str(self.obj_15v), "pps\n\tvmin: 3.00 V\n"
|
|
@@ -531,8 +531,19 @@ class PDOListCalculationsTestCase(unittest.TestCase):
|
531
|
531
|
False, False, 0, 15000, 3000)
|
532
|
532
|
self.src_fixed_20v_2p25a = pdbuddy.SrcFixedPDO(False, False, False,
|
533
|
533
|
False, False, False, 0, 20000, 2250)
|
|
534
|
+ self.src_fixed_20v_3a = pdbuddy.SrcFixedPDO(False, False, False, False,
|
|
535
|
+ False, False, 0, 20000, 3000)
|
534
|
536
|
self.src_fixed_20v_5a = pdbuddy.SrcFixedPDO(False, False, False, False,
|
535
|
537
|
False, False, 0, 20000, 5000)
|
|
538
|
+ self.src_pps_5v_1p5a = pdbuddy.SrcPPSAPDO(3000, 5900, 1500)
|
|
539
|
+ self.src_pps_5v_3a = pdbuddy.SrcPPSAPDO(3000, 5900, 3000)
|
|
540
|
+ self.src_pps_9v_1p6a = pdbuddy.SrcPPSAPDO(3000, 11000, 1600)
|
|
541
|
+ self.src_pps_9v_3a = pdbuddy.SrcPPSAPDO(3000, 11000, 3000)
|
|
542
|
+ self.src_pps_10v_1p5a = pdbuddy.SrcPPSAPDO(3000, 10000, 1500)
|
|
543
|
+ self.src_pps_15v_1p8a = pdbuddy.SrcPPSAPDO(3000, 16000, 1800)
|
|
544
|
+ self.src_pps_15v_3a = pdbuddy.SrcPPSAPDO(3000, 16000, 3000)
|
|
545
|
+ self.src_pps_20v_2p25a = pdbuddy.SrcPPSAPDO(3000, 21000, 2250)
|
|
546
|
+ self.src_pps_20v_5a = pdbuddy.SrcPPSAPDO(3000, 21000, 5000)
|
536
|
547
|
self.typec_virtual_1p5a = pdbuddy.TypeCVirtualPDO(1500)
|
537
|
548
|
|
538
|
549
|
def test_calculate_pdp_typec_virtual(self):
|
|
@@ -571,17 +582,38 @@ class PDOListCalculationsTestCase(unittest.TestCase):
|
571
|
582
|
self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a]))
|
572
|
583
|
self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
573
|
584
|
self.src_fixed_9v_1p6a]))
|
|
585
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
|
586
|
+ self.src_pps_5v_1p5a]))
|
|
587
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
588
|
+ self.src_pps_5v_3a]))
|
|
589
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
590
|
+ self.src_fixed_9v_1p6a, self.src_pps_5v_3a]))
|
|
591
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
592
|
+ self.src_fixed_9v_1p6a, self.src_pps_5v_3a,
|
|
593
|
+ self.src_pps_9v_1p6a]))
|
574
|
594
|
# <= 27 W
|
575
|
595
|
self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
576
|
596
|
self.src_fixed_9v_3a]))
|
577
|
597
|
self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
578
|
598
|
self.src_fixed_9v_3a, self.src_fixed_15v_1p8a]))
|
|
599
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
600
|
+ self.src_fixed_9v_3a, self.src_pps_9v_3a]))
|
|
601
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
602
|
+ self.src_fixed_9v_3a, self.src_pps_5v_3a, self.src_pps_9v_3a,
|
|
603
|
+ self.src_pps_15v_1p8a]))
|
579
|
604
|
# <= 45 W
|
580
|
605
|
self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
581
|
606
|
self.src_fixed_9v_3a, self.src_fixed_15v_3a]))
|
582
|
607
|
self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
583
|
608
|
self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
584
|
609
|
self.src_fixed_20v_2p25a]))
|
|
610
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
611
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
612
|
+ self.src_pps_15v_3a]))
|
|
613
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
614
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
615
|
+ self.src_pps_9v_3a, self.src_pps_15v_3a,
|
|
616
|
+ self.src_pps_20v_2p25a]))
|
585
|
617
|
# <= 100 W
|
586
|
618
|
self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
587
|
619
|
self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
@@ -590,22 +622,60 @@ class PDOListCalculationsTestCase(unittest.TestCase):
|
590
|
622
|
self.src_fixed_9v_3a, self.src_fixed_10v_1p5a,
|
591
|
623
|
self.src_fixed_12v_5a, self.src_fixed_15v_3a,
|
592
|
624
|
self.src_fixed_20v_5a]))
|
|
625
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
626
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
627
|
+ self.src_fixed_20v_5a, self.src_pps_20v_5a]))
|
|
628
|
+ self.assertTrue(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
629
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
630
|
+ self.src_fixed_20v_5a, self.src_pps_9v_3a, self.src_pps_15v_3a,
|
|
631
|
+ self.src_pps_20v_5a]))
|
593
|
632
|
|
594
|
633
|
def test_follows_power_rules_false(self):
|
595
|
634
|
# <= 15 W
|
596
|
635
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_10v_1p5a]))
|
597
|
636
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
598
|
637
|
self.src_fixed_10v_1p5a]))
|
|
638
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
|
639
|
+ self.src_pps_5v_3a]))
|
|
640
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
|
641
|
+ self.src_pps_9v_1p6a]))
|
|
642
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
|
643
|
+ self.src_pps_10v_1p5a]))
|
|
644
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
|
645
|
+ self.src_pps_15v_3a]))
|
|
646
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
|
647
|
+ self.src_pps_20v_2p25a]))
|
|
648
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
649
|
+ self.src_pps_5v_1p5a]))
|
|
650
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
651
|
+ self.src_pps_9v_1p6a]))
|
599
|
652
|
# <= 27 W
|
600
|
653
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_9v_3a]))
|
601
|
654
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
602
|
655
|
self.src_fixed_9v_3a]))
|
|
656
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
657
|
+ self.src_fixed_9v_3a, self.src_pps_5v_1p5a,
|
|
658
|
+ self.src_pps_9v_3a]))
|
|
659
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
660
|
+ self.src_fixed_9v_3a, self.src_pps_5v_3a,
|
|
661
|
+ self.src_pps_9v_1p6a]))
|
603
|
662
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
604
|
663
|
self.src_fixed_9v_1p6a, self.src_fixed_15v_1p8a]))
|
|
664
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
665
|
+ self.src_fixed_9v_3a, self.src_pps_15v_1p8a]))
|
605
|
666
|
# <= 45 W
|
606
|
667
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_20v_2p25a]))
|
607
|
668
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
608
|
669
|
self.src_fixed_9v_3a, self.src_fixed_15v_3a]))
|
|
670
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
671
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
672
|
+ self.src_pps_9v_3a]))
|
|
673
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
674
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
675
|
+ self.src_pps_9v_1p6a, self.src_pps_15v_3a]))
|
|
676
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
677
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
678
|
+ self.src_pps_9v_3a, self.src_pps_15v_1p8a]))
|
609
|
679
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
610
|
680
|
self.src_fixed_9v_1p6a, self.src_fixed_15v_3a]))
|
611
|
681
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
@@ -613,6 +683,9 @@ class PDOListCalculationsTestCase(unittest.TestCase):
|
613
|
683
|
self.src_fixed_20v_2p25a]))
|
614
|
684
|
# <= 100 W
|
615
|
685
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_20v_5a]))
|
|
686
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
687
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
688
|
+ self.src_fixed_20v_3a, self.src_pps_20v_2p25a]))
|
616
|
689
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_1p5a,
|
617
|
690
|
self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
618
|
691
|
self.src_fixed_20v_5a]))
|
|
@@ -625,3 +698,9 @@ class PDOListCalculationsTestCase(unittest.TestCase):
|
625
|
698
|
self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
626
|
699
|
self.src_fixed_9v_3a, self.src_fixed_12v_5a,
|
627
|
700
|
self.src_fixed_15v_3a, self.src_fixed_20v_2p25a]))
|
|
701
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
702
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
703
|
+ self.src_fixed_20v_5a, self.src_pps_15v_1p8a]))
|
|
704
|
+ self.assertFalse(pdbuddy.follows_power_rules([self.src_fixed_5v_3a,
|
|
705
|
+ self.src_fixed_9v_3a, self.src_fixed_15v_3a,
|
|
706
|
+ self.src_fixed_20v_5a, self.src_pps_15v_3a]))
|