def test_get_group_pairs_1_pass_out_of_3(self): probe_group, matches, scif = self.create_scene_scif_matches_stitch_groups_data_mocks( DataTestUnitPEPSICOUK.test_case_1, 1) scene_tb = PEPSICOUKSceneToolBox(self.data_provider_mock, self.output) scene_tb.block_results = DataTestUnitPEPSICOUK.blocks_combinations_1_pass_of_3 pairs = scene_tb.get_group_pairs() self.assertEquals(len(pairs), 0)
def test_get_group_pairs_2_pass_out_of_3(self): probe_group, matches, scif = self.create_scene_scif_matches_stitch_groups_data_mocks( DataTestUnitPEPSICOUK.test_case_1, 1) scene_tb = PEPSICOUKSceneToolBox(self.data_provider_mock, self.output) scene_tb.block_results = DataTestUnitPEPSICOUK.blocks_combinations_2_pass_of_3 pairs = scene_tb.get_group_pairs() expected_result = [frozenset(['Group 2', 'Group 1'])] self.assertEquals(len(pairs), 1) self.assertItemsEqual(pairs, expected_result)
def test_get_group_pairs_4_pass_out_of_4(self): probe_group, matches, scif = self.create_scene_scif_matches_stitch_groups_data_mocks( DataTestUnitPEPSICOUK.test_case_1, 1) self.mock_object('PositionGraphs', path='KPIUtils_v2.Calculations.AdjacencyCalculations') scene_tb = PEPSICOUKSceneToolBox(self.data_provider_mock, self.output) scene_tb.block_results = DataTestUnitPEPSICOUK.blocks_combinations_4_pass_of_4 pairs = scene_tb.get_group_pairs() expected = [ frozenset(['Group 3', 'Group 1']), frozenset(['Group 4', 'Group 2']), frozenset(['Group 4', 'Group 3']), frozenset(['Group 2', 'Group 3']), frozenset(['Group 4', 'Group 1']), frozenset(['Group 2', 'Group 1']) ] self.assertEquals(len(pairs), 6) self.assertItemsEqual(pairs, expected)