From 8f8518320b32cd002f5d621c3b440878c125add4 Mon Sep 17 00:00:00 2001 From: vohorgeez Date: Sat, 14 Nov 2026 16:36:39 +0100 Subject: [PATCH] =?UTF-8?q?test(blob=5Fdetector):=20blob=5Fdetector=20d?= =?UTF-8?q?=C3=A9tecte=20un=20blob?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/tests_pipeline_b.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/tests_pipeline_b.py b/tests/tests_pipeline_b.py index b37b45c..8618b40 100644 --- a/tests/tests_pipeline_b.py +++ b/tests/tests_pipeline_b.py @@ -19,11 +19,11 @@ def test_file_does_not_exists(tmp_path): with pytest.raises(FileNotFoundError): star_detector.reading_picture(tmp_path/"do_I_exist.txt") -@pytest.mark.skip(reason="A corriger : égalité stricte sur flottants, canall couleur incohérent, détour disque inutile") -def test_blob_detector_actually_detects_a_blob(tmp_path): - file = tmp_path / "image.jpg" - tableau_image = np.full((64,64), 0, dtype=np.uint8) - cv2.imwrite(str(file), tableau_image) - src = cv2.imread(file) - cv2.circle(src, center=(23, 31), radius = 5, color= (255, 255, 255), thickness=-1) - assert star_detector.blob_detector(src) == [(23, 31)] \ No newline at end of file +def test_blob_detector_actually_detects_a_blob(): + tableau_image = np.zeros((64,64), dtype=np.uint8) + cv2.circle(tableau_image, center=(23, 31), radius = 5, color= 255, thickness=-1) + assertion = (star_detector.blob_detector(tableau_image) != []) + for star in star_detector.blob_detector(tableau_image): + if abs(star[0] - 23) > 0.001 or abs(star[1] - 31) > 0.001: + assertion = False + assert assertion == True \ No newline at end of file