Remove mockings (#3378)

* removed mock break lines

* removing debug print

* keeping break line
This commit is contained in:
Henrique Joaquim
2022-11-11 18:42:00 +00:00
committed by GitHub
parent aed683f440
commit 9d26d7746d
3 changed files with 3 additions and 13 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -1 +1 @@
MOCKING_BREAKLINE MOCKING_BREAKLINE hello MOCKING_TAB his MOCKING_CARRIAGE_RETURN MOCKING_CARRIAGE_RETURN greetings
MOCKING_BREAKLINE hello this is greetings