Esempio n. 1
0
 def process_box_characters(self, screen):
     if not self.repl.config.unicode_box or not config.supports_box_chars():
         return [
             line.replace("┌",
                          "+").replace("└", "+").replace("┘", "+").replace(
                              "┐", "+").replace("─", "-") for line in screen
         ]
     return screen
    def test_paint_lasts_events(self):
        actual = replpainter.paint_last_events(
            4, 100, ["a", "b", "c"], config=setup_config()
        )
        if config.supports_box_chars():
            expected = fsarray(["┌─┐", "│c│", "│b│", "└─┘"])
        else:
            expected = fsarray(["+-+", "|c|", "|b|", "+-+"])

        self.assertFSArraysEqualIgnoringFormatting(actual, expected)
    def test_paint_lasts_events(self):
        actual = replpainter.paint_last_events(4, 100, ['a', 'b', 'c'],
                                               config=setup_config())
        if config.supports_box_chars():
            expected = fsarray(["┌─┐",
                                "│c│",
                                "│b│",
                                "└─┘"])
        else:
            expected = fsarray(["+-+",
                                "|c|",
                                "|b|",
                                "+-+"])

        self.assertFSArraysEqualIgnoringFormatting(actual, expected)
 def test_completion(self):
     self.repl.height, self.repl.width = (5, 32)
     self.repl.current_line = 'an'
     self.cursor_offset = 2
     if config.supports_box_chars():
         screen = ['>>> an',
                   '┌───────────────────────┐',
                   '│ and  any(             │',
                   '└───────────────────────┘',
                   'Welcome to bpython! Press <F1> f']
     else:
         screen = ['>>> an',
                   '+-----------------------+',
                   '| and  any(             |',
                   '+-----------------------+',
                   'Welcome to bpython! Press <F1> f']
     self.assert_paint_ignoring_formatting(screen, (0, 4))
 def test_completion(self):
     self.repl.height, self.repl.width = (5, 32)
     self.repl.current_line = 'an'
     self.cursor_offset = 2
     if config.supports_box_chars():
         screen = [
             '>>> an', '┌───────────────────────┐',
             '│ and  any(             │', '└───────────────────────┘',
             'Welcome to bpython! Press <F1> f'
         ]
     else:
         screen = [
             '>>> an', '+-----------------------+',
             '| and  any(             |', '+-----------------------+',
             'Welcome to bpython! Press <F1> f'
         ]
     self.assert_paint_ignoring_formatting(screen, (0, 4))
Esempio n. 6
0
 def test_completion(self):
     self.repl.height, self.repl.width = (5, 32)
     self.repl.current_line = 'se'
     self.cursor_offset = 2
     if config.supports_box_chars():
         screen = [u'>>> se',
                   u'┌───────────────────────┐',
                   u'│ set(     setattr(     │',
                   u'└───────────────────────┘',
                   u'Welcome to bpython! Press <F1> f']
     else:
         screen = [u'>>> se',
                   u'+-----------------------+',
                   u'| set(     setattr(     |',
                   u'+-----------------------+',
                   u'Welcome to bpython! Press <F1> f']
     self.assert_paint_ignoring_formatting(screen, (0, 4))
 def test_completion(self):
     self.repl.height, self.repl.width = (5, 32)
     self.repl.current_line = "an"
     self.cursor_offset = 2
     if config.supports_box_chars():
         screen = [
             ">>> an",
             "┌──────────────────────────────┐",
             "│ and  any(                    │",
             "└──────────────────────────────┘",
             "Welcome to bpython! Press <F1> f",
         ]
     else:
         screen = [
             ">>> an",
             "+------------------------------+",
             "| and  any(                    |",
             "+------------------------------+",
             "Welcome to bpython! Press <F1> f",
         ]
     self.assert_paint_ignoring_formatting(screen, (0, 4))