16
16
problem_1280 ,
17
17
problem_1321 ,
18
18
problem_1378 ,
19
+ problem_1517 ,
19
20
problem_1581 ,
20
21
problem_1661 ,
21
22
problem_1683 ,
@@ -606,7 +607,7 @@ def test_problem_1280(input_data_1, input_data_2, input_data_3, expected_data):
606
607
)
607
608
def test_problem_1321 (input_data , expected_data ):
608
609
table = pd .DataFrame (input_data )
609
- expected_table = pd .DataFrame (expected_data ). reset_index ( drop = True )
610
+ expected_table = pd .DataFrame (expected_data )
610
611
result = (
611
612
problem_1321 (table )
612
613
.reset_index (drop = True )
@@ -641,7 +642,7 @@ def test_problem_1321(input_data, expected_data):
641
642
def test_problem_1378 (input_data_1 , input_data_2 , expected_data ):
642
643
table_1 = pd .DataFrame (input_data_1 )
643
644
table_2 = pd .DataFrame (input_data_2 )
644
- expected_table = pd .DataFrame (expected_data ). reset_index ( drop = True )
645
+ expected_table = pd .DataFrame (expected_data )
645
646
result = (
646
647
problem_1378 (table_1 , table_2 )
647
648
.reset_index (drop = True )
@@ -656,6 +657,97 @@ def test_problem_1378(input_data_1, input_data_2, expected_data):
656
657
assert result .equals (expected_table )
657
658
658
659
660
+ @pytest .mark .parametrize (
661
+ "input_data, expected_data" ,
662
+ [
663
+ pytest .param (
664
+ {
665
+ "user_id" : [1 , 2 , 3 , 4 , 5 , 6 , 7 ],
666
+ "name" : [
667
+ "Winston" ,
668
+ "Jonathan" ,
669
+ "Annabelle" ,
670
+ "Sally" ,
671
+ "Marwan" ,
672
+ "David" ,
673
+ "Shapiro" ,
674
+ ],
675
+ "mail" : [
676
+ "winston@leetcode.com" ,
677
+ "jonathanisgreat" ,
678
+ "bella-@leetcode.com" ,
679
+ "sally.come@leetcode.com" ,
680
+ "quarz#2020@leetcode.com" ,
681
+ "david69@gmail.com" ,
682
+ ".shapo@leetcode.com" ,
683
+ ],
684
+ },
685
+ {
686
+ "user_id" : [1 , 3 , 4 ],
687
+ "name" : [
688
+ "Winston" ,
689
+ "Annabelle" ,
690
+ "Sally" ,
691
+ ],
692
+ "mail" : [
693
+ "winston@leetcode.com" ,
694
+ "bella-@leetcode.com" ,
695
+ "sally.come@leetcode.com" ,
696
+ ],
697
+ },
698
+ id = "happy_path" ,
699
+ ),
700
+ pytest .param (
701
+ {
702
+ "user_id" : [360 , 966 , 901 , 162 , 181 , 240 , 221 , 388 , 211 , 178 ],
703
+ "name" : [
704
+ "Ezra" ,
705
+ "Daniel" ,
706
+ "Yehudah" ,
707
+ "Daniel" ,
708
+ "Aharon" ,
709
+ "Gavriel" ,
710
+ "Levi" ,
711
+ "Eliyahu" ,
712
+ "Michael" ,
713
+ "Aharon" ,
714
+ ],
715
+ "mail" : [
716
+ "Ezra4VZabfK" ,
717
+ "DanielEnEMjNoG6" ,
718
+ "Yehudah*5m9@leetcode.com" ,
719
+ "Daniel07L@leetcode.com" ,
720
+ "AharonxuZA530S8Q" ,
721
+ "GavrielLVC@leetcode.com" ,
722
+ "Leviz6OzK@leetcode.com" ,
723
+ "Eliyahu--wzsgX@leetcode.com" ,
724
+ ".Michael@leetcode.com" ,
725
+ "AharonnDFFSqcY" ,
726
+ ],
727
+ },
728
+ {
729
+ "user_id" : [162 , 240 , 221 , 388 ],
730
+ "name" : ["Daniel" , "Gavriel" , "Levi" , "Eliyahu" ],
731
+ "mail" : [
732
+ "Daniel07L@leetcode.com" ,
733
+ "GavrielLVC@leetcode.com" ,
734
+ "Leviz6OzK@leetcode.com" ,
735
+ "Eliyahu--wzsgX@leetcode.com" ,
736
+ ],
737
+ },
738
+ id = "happy_path_2" ,
739
+ ),
740
+ ],
741
+ )
742
+ def test_problem_1517 (input_data , expected_data ):
743
+ table = pd .DataFrame (input_data )
744
+ expected_table = pd .DataFrame (expected_data )
745
+ result = problem_1517 (table ).reset_index (drop = True )
746
+ assert_frame_equal (
747
+ result , expected_table , check_dtype = False , check_index_type = False
748
+ )
749
+
750
+
659
751
@pytest .mark .parametrize (
660
752
"input_data_1, input_data_2, expected_data" ,
661
753
[
0 commit comments