Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_lg_char_escaping(self):
formatter = Formatter(True)
self.assertEqual('foosome info',
formatter.format('\\some info\\')
)
self.assertEqual(
'\\some info\\',
Formatter.escape('some info')
)
def test_style_matching_non_greedy(self):
formatter = Formatter(True)
self.assertEqual(
'(\033[32m>=2.0,<2.3\033[0m)',
formatter.format('(>=2.0,<2.3)')
)
def test_style_escaping(self):
formatter = Formatter(True)
self.assertEqual(
'(\033[32mz>=2.0,%s)' % formatter.escape('z>=2.0,
def test_adjacent_style(self):
formatter = Formatter(True)
self.assertEqual(
'\033[37;41msome error\033[0m\033[32msome info\033[0m',
formatter.format('some errorsome info')
)
def test_content_with_line_breaks(self):
formatter = Formatter(True)
for expected, message in self.provide_content_with_line_breaks():
self.assertEqual(expected, formatter.format(message))
def test_deep_nested_style(self):
formatter = Formatter(True)
self.assertEqual(
'\033[37;41merror\033[0m\033[32minfo\033[0m\033[33mcomment\033[0m\033[37;41merror\033[0m',
formatter.format('errorinfocommenterror')
)
def __init__(self, verbosity=VERBOSITY_NORMAL, decorated=False, formatter=None):
self.verbosity = self.VERBOSITY_NORMAL if verbosity is None else verbosity
self.formatter = formatter or Formatter(decorated)
def get_formatter(self):
return Formatter()
def __init__(self, path=None):
BaseApplication.__init__(self, "Jetty", __version__)
self._path = path
self._poetry = None
self._skip_io_configuration = False
self._formatter = Formatter(True)
self._formatter.add_style("error", "red", options=["bold"])