mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 05:52:23 +00:00
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -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 "),
|
||||
|
||||
Reference in New Issue
Block a user