@@ -108,7 +108,7 @@ def test_can_perform_faceted_paging_search_with_no_page_size_no_max_results_hits
108108 camera_counts [d .manufacturer ] += 1
109109
110110 cameras_by_hits = list (
111- map (lambda x : x [0 ].lower (), sorted (camera_counts .items (), key = lambda item : item [1 ], reverse = True )[2 :])
111+ map (lambda x : x [0 ].lower (), sorted (camera_counts .items (), key = lambda item :( - item [1 ],item [ 0 ]) )[2 :])
112112 )
113113
114114 self .assertEqual (3 , len (facet_results ["manufacturer" ].values ))
@@ -147,7 +147,7 @@ def test_can_perform_faceted_paging_search_with_no_page_size_with_max_results_hi
147147 camera_counts [d .manufacturer ] += 1
148148
149149 cameras_by_hits = list (
150- map (lambda x : x [0 ].lower (), sorted (camera_counts .items (), key = lambda item : item [1 ], reverse = True )[2 :])
150+ map (lambda x : x [0 ].lower (), sorted (camera_counts .items (), key = lambda item :( - item [1 ],item [ 0 ]) )[2 :])
151151 )
152152
153153 self .assertEqual (2 , len (facet_results .get ("manufacturer" ).values ))
@@ -160,9 +160,6 @@ def test_can_perform_faceted_paging_search_with_no_page_size_with_max_results_hi
160160 self .assertEqual (1 , facet_results .get ("manufacturer" ).remaining_terms_count )
161161 self .assertEqual (1 , len (facet_results .get ("manufacturer" ).remaining_terms ))
162162 counts = list (
163- map (
164- lambda x : x [1 ],
165- sorted (camera_counts .items (), key = lambda item : item [1 ], reverse = True )[2 :],
166- )
163+ map (lambda x : x [1 ], sorted (camera_counts .items (), key = lambda item : (- item [1 ], item [0 ]))[2 :])
167164 )
168165 self .assertEqual (facet_results .get ("manufacturer" ).remaining_hits , counts [- 1 ])
0 commit comments