Skip to content

Commit

Permalink
prep mock
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Jan 15, 2024
1 parent ccd1ca7 commit f459013
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cat_win/tests/mocks/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
"""

import io
# import re

# ansi_escape_8bit = re.compile(r'''
# (?: # either 7-bit C1, two bytes, ESC Fe (omitting CSI)
# \x1B
# [@-Z\\-_]
# # | # or a single 8-bit byte Fe (omitting CSI)
# # [\x80-\x9A\x9C-\x9F]
# | # or CSI + control codes
# (?: # 7-bit CSI, ESC [
# \x1B\[
# | # 8-bit CSI, 9B
# \x9B
# )
# [0-?]* # Parameter bytes
# [ -/]* # Intermediate bytes
# [@-~] # Final byte
# )
# ''', re.VERBOSE)


class StdOutMock(io.StringIO):
Expand All @@ -12,6 +31,9 @@ class StdOutMock(io.StringIO):
# def reconfigure(self, encoding = None) -> None:
# return

# def write(self, s: str = '') -> int:
# return super().write(ansi_escape_8bit.sub('', s))

def fileno(self) -> int:
return 1

Expand Down

0 comments on commit f459013

Please sign in to comment.