Skip to content

Commit b20f221

Browse files
author
rootware
committed
some progress on mock test
1 parent 149b981 commit b20f221

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/test_custom_redact_engine.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
import os
3+
import json
34
from pyredactkit.custom_redactor import CustomRedactorEngine
45
data = """John, please get that article on www.linkedin.com to me by 5:00PM on Jan 9th 2012. 4:00 would be ideal, actually. If you have any questions, You can reach me at(519)-236-2723 or get in touch with my associate at [email protected]
56
this is my IP: 102.23.5.1
@@ -51,18 +52,13 @@ def custom_redactor():
5152

5253

5354
@pytest.fixture
54-
def mocker_text_file(mocker):
55-
content = "Message to write on file to be written"
55+
def mocker_json_file(mocker):
56+
content = {"key": "value"}
5657
mocked_open = mocker.mock_open(read_data=content)
5758
builtin_open = "builtins.open"
5859
mocker.patch(builtin_open, mocked_open)
5960

60-
61-
# def test_write_hashmap_should_create_json_file(custom_redactor, tmp_path):
62-
# hash_map = {"key": "value"}
63-
# custom_redactor.write_hashmap(hash_map, filename='fakefile', savedir=tmp_path)
64-
65-
# def test_redact_custom_function_should_return_string_and_dictionary(custom_redactor):
61+
# def test_redact_custom_function_should_return_string_and_dictionary(custom_redactor,mocker_json_file):
6662
# set1 = custom_redactor.redact_custom(data)
6763
# set2 = ("This is a string", hash_table)
6864
# assert isinstance(type(set1[0]), str), "1st element of redact_custom function should return string"

0 commit comments

Comments
 (0)