Revert "fix log formatter test"

This reverts commit 335ac7a3d7.
This commit is contained in:
montezdesousa
2023-09-04 21:53:59 +01:00
parent 335ac7a3d7
commit c40a64f8ef
2 changed files with 5 additions and 5 deletions

View File

@@ -76,7 +76,7 @@ class FormatterWithExceptions(logging.Formatter):
@staticmethod
def mock_home_directory(text: str) -> str:
user_home_directory = str(Path.home().as_posix())
text_mocked = text.replace("\\", "/").replace(
text_mocked = text.replace("\\\\", "/").replace(
user_home_directory, "MOCKING_USER_PATH"
)

View File

@@ -198,12 +198,12 @@ def test_mock_flair(input_text, expected_output, formatter):
[
(
"This is C:\\Users\\username\\file.txt",
"This is C:/Users/username/file.txt",
"This is C:\\Users\\username\\file.txt",
),
("No home directory here!", "No home directory here!"),
(
f"This is {os.path.expanduser('~')}\\file.txt",
"This is MOCKING_USER_PATH/file.txt",
"This is MOCKING_USER_PATH\\file.txt",
),
(
f"Some path: {os.path.expanduser('~/subfolder')}",
@@ -240,7 +240,7 @@ def test_filter_special_tags(input_text, expected_output, formatter):
[
(
f"This is {os.path.expanduser('~')}\\file.txt",
"This is MOCKING_USER_PATH/file.txt",
"This is MOCKING_USER_PATH\\file.txt",
),
('{"FLAIR": "[announcement]"}', '{"FLAIR": "[ FILTERED_FLAIR ]"}'),
("Another email: alice@example.co.uk", "Another email: FILTERED_EMAIL "),
@@ -257,7 +257,7 @@ def test_filter_piis(input_text, expected_output, formatter):
[
(
f"This is {os.path.expanduser('~')}\\file.txt",
"This is MOCKING_USER_PATH/file.txt",
"This is MOCKING_USER_PATH\\file.txt",
),
('{"FLAIR": "[announcement]"}', '{"FLAIR": "[ FILTERED_FLAIR ]"}'),
("Another email: alice@example.co.uk", "Another email: FILTERED_EMAIL "),