mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Remove mockings (#3378)
* removed mock break lines * removing debug print * keeping break line
This commit is contained in:
@@ -67,19 +67,9 @@ class FormatterWithExceptions(logging.Formatter):
|
||||
|
||||
return text_mocked
|
||||
|
||||
@staticmethod
|
||||
def mock_break_lines(text: str) -> str:
|
||||
text_mocked = text.replace("\n", " MOCKING_BREAKLINE ")
|
||||
text_mocked = text_mocked.replace("\r", " MOCKING_CARRIAGE_RETURN ")
|
||||
text_mocked = text_mocked.replace("\t", " MOCKING_TAB ")
|
||||
text_mocked = text_mocked.replace("\\n", " MOCKING_BREAKLINE ")
|
||||
text_mocked = text_mocked.replace("\\r", " MOCKING_CARRIAGE_RETURN ")
|
||||
|
||||
return text_mocked
|
||||
|
||||
@classmethod
|
||||
def filter_special_tags(cls, text: str) -> str:
|
||||
text_filtered = cls.mock_break_lines(text=text)
|
||||
text_filtered = text.replace("\n", " MOCKING_BREAKLINE ")
|
||||
text_filtered = text_filtered.replace("'Traceback", "Traceback")
|
||||
|
||||
return text_filtered
|
||||
|
||||
@@ -46,7 +46,7 @@ def test_filter_log_line(recorder):
|
||||
text_expected = FormatterWithExceptions.filter_log_line(text=text)
|
||||
recorder.capture(text_expected)
|
||||
|
||||
text = "\\n\nhello \this\\r \rgreetings"
|
||||
text = "\nhello this is greetings"
|
||||
text_expected = FormatterWithExceptions.filter_log_line(text=text)
|
||||
recorder.capture(text_expected)
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
MOCKING_BREAKLINE MOCKING_BREAKLINE hello MOCKING_TAB his MOCKING_CARRIAGE_RETURN MOCKING_CARRIAGE_RETURN greetings
|
||||
MOCKING_BREAKLINE hello this is greetings
|
||||
Reference in New Issue
Block a user