Skip to content

Commit

Permalink
resolving conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
l-r-sowmya committed Jun 4, 2024
1 parent 57fce6d commit c855bf1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
File renamed without changes.
30 changes: 16 additions & 14 deletions tests/analyzer_engine/image_redactor_test.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
from unittest import TestCase

from analyzer_engine.image_redactor import ImageRedactor
import pytest
import os
import shutil
from analyzer_engine.image_redactor import ImageRedactor

OUTPUT_DIR = "output"


class ImageRedactorTest(TestCase):
@pytest.fixture(scope="module")
def img_red():
return ImageRedactor()


def setUp(self) -> None:
self.img_red = ImageRedactor()
os.makedirs(OUTPUT_DIR, exist_ok=True)
@pytest.fixture(autouse=True, scope="module")
def setup_and_teardown():
os.makedirs(OUTPUT_DIR, exist_ok=True)
yield
shutil.rmtree(OUTPUT_DIR)

def tearDown(self) -> None:
import shutil
shutil.rmtree(OUTPUT_DIR)

def test_detects_pii_in_image_successfully(self):
image = self.img_red.detect_pii("./data/ocr_text.png")
image.save("./output/modified.png")
self.assertTrue(os.path.isfile("./output/modified.png"))
def test_detects_pii_in_image_successfully(img_red):
image = img_red.detect_pii("./data/ocr_text.png")
image.save("./output/modified.png")
assert os.path.isfile("./output/modified.png")

0 comments on commit c855bf1

Please sign in to comment.