1+ import pytest
2+ import os
3+ from pyredactkit .custom_redactor import CustomRedactorEngine
4+ 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] 5+ this is my IP: 102.23.5.1
6+ My router is : 10.10.10.1
7+ 71.159.188.33
8+ 81.141.167.45
9+ 165.65.59.139
10+ 64.248.67.225
11+
12+ https://tech.gov.sg
13+
14+ 15+
16+ this is my IP: 102.23.5.1
17+ My router is: 10.10.10.1
18+ 71.159.188.33
19+ 81.141.167.45
20+ 165.65.59.139
21+ 64.248.67.225
22+
23+ Card_Number,Card_Family,Credit_Limit,Cust_ID
24+ 8638-5407-3631-8196,Premium,530000,CC67088
25+ 7106-4239-7093-1515,Gold,18000,CC12076
26+ 6492-5655-8241-3530,Premium,596000,CC97173
27+ 2868-5606-5152-5706,Gold,27000,CC55858
28+ 1438-6906-2509-8219,Platinum,142000,CC90518
29+ 2764-7023-8396-5255,Gold,50000,CC49168
30+ 4864-7119-5608-7611,Premium,781000,CC66746
31+ 5160-8427-6529-3274,Premium,490000,CC28930
32+ 6691-5105-1556-4131,Premium,640000,CC76766
33+ 1481-2536-2178-7547,Premium,653000,CC18007
34+ 1355-1728-8274-9593,Premium,660000,CC23267
35+ 9621-6787-7890-7470,Platinum,53000,CC52613
36+ 6385-4594-8055-9081,Premium,737000,CC96267
37+ 2595-8621-2855-9119,Premium,564000,CC22050
38+ 7214-4915-6387-5429,Platinum,172000,CC72302
39+ 7908-3850-6633-2606,Gold,43000,CC71044
40+ """
41+
42+
43+ people_names = "John,Jones,Alex,Bruce"
44+ mask_names = "\u2588 " * 15
45+ count_names = 4
46+ hash_table = {}
47+
48+ @pytest .fixture
49+ def custom_redactor ():
50+ return CustomRedactorEngine ()
51+
52+
53+ @pytest .fixture
54+ def mocker_text_file (mocker ):
55+ content = "Message to write on file to be written"
56+ mocked_open = mocker .mock_open (read_data = content )
57+ builtin_open = "builtins.open"
58+ mocker .patch (builtin_open , mocked_open )
59+
60+
61+ # def test_redact_custom_function_should_return_string_and_dictionary(custom_redactor):
62+ # set1 = custom_redactor.redact_custom(data)
63+ # set2 = ("This is a string", hash_table)
64+ # assert isinstance(type(set1[0]), str), "1st element of redact_custom function should return string"
65+ # assert isinstance(type(set1[1]), dict), "2nd element of redact_custom function should return dictionary"
66+ # assert type(set1) == type(set2), "redact_custom function should return a tuple"
0 commit comments