示例#1
0
 def test_adjacency_passes(self):
     probe_group, matches, scif = self.create_scene_scif_matches_stitch_groups_data_mocks(
         DataTestUnitPEPSICOUK.test_case_1, 1)
     self.mock_adjacency_results(
         [DataTestUnitPEPSICOUK.adjacency_results_true])
     scene_tb = PEPSICOUKSceneToolBox(self.data_provider_mock, self.output)
     scene_tb.passed_blocks = {
         'Pringles_FTT_Tubes': DataTestUnitPEPSICOUK.block_results,
         'Hula Hoops_LMP_Snacks': DataTestUnitPEPSICOUK.block_results_2
     }
     scene_tb.block_results = DataTestUnitPEPSICOUK.blocks_all_pass
     scene_tb.calculate_adjacency_new()
     kpi_result = scene_tb.kpi_results
     self.assertEquals(len(kpi_result), 1)
     expected_list = list()
     expected_list.append({
         'kpi_fk': 320,
         'numerator': 166,
         'denominator': 165,
         'result': 4,
         'score': 1
     })
     test_result_list = []
     for expected_result in expected_list:
         test_result_list.append(
             self.check_kpi_results(kpi_result, expected_result) == 1)
     self.assertTrue(all(test_result_list))
示例#2
0
 def test_adjacency_no_results_if_no_blocks_pass(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_none_passes
     scene_tb.calculate_adjacency_new()
     self.assertTrue(scene_tb.kpi_results.empty)