Ejemplo n.º 1
0
 def test_long_title_truncated(self):
     """very wide data does not imply wery wide title"""
     tbl = TextTable("%one %two")
     tbl.title = "title"
     tbl.append({'one': 'foobar', 'two': ' go' * 100})
     self.assertEqual(str(tbl),
                 "== title =\n"
                 "ONE    TWO\n"
                 "---    ---\n"
                 "foobar " + ' go' * 100)
Ejemplo n.º 2
0
 def test_long_title_truncated(self):
     """very wide data does not imply wery wide title"""
     tbl = TextTable("%one %two")
     tbl.title = "title"
     tbl.append({'one': 'foobar', 'two': ' go' * 100})
     self.assertEqual(str(tbl),
                 "== title =\n"
                 "ONE    TWO\n"
                 "---    ---\n"
                 "foobar " + ' go' * 100)
Ejemplo n.º 3
0
    def test_title_with_color(self):
        """display with title and color"""
        tbl = TextTable("%filesystem %two")
        tbl.title = "title"
        tbl.color = True
        tbl.append({'filesystem': 'foo', 'two': 'bar'})
        self.assertEqual(str(tbl), 
"====\033[34m title \033[0m===\n"
"\033[34mFILESYSTEM TWO\033[0m\n"
"---------- ---\n"
"foo        bar")
Ejemplo n.º 4
0
    def test_title_with_color(self):
        """display with title and color"""
        tbl = TextTable("%filesystem %two")
        tbl.title = "title"
        tbl.color = True
        tbl.append({'filesystem': 'foo', 'two': 'bar'})
        self.assertEqual(str(tbl),
"====\033[34m title \033[0m===\n"
"\033[34mFILESYSTEM TWO\033[0m\n"
"---------- ---\n"
"foo        bar")
Ejemplo n.º 5
0
 def test_title(self):
     """display with a simple title"""
     tbl = TextTable("%one")
     tbl.title = "test title"
     tbl.append({'one': 'foo'})
     self.assertEqual(str(tbl), "= test title =\nONE\n---\nfoo")
Ejemplo n.º 6
0
 def test_title(self):
     """display with a simple title"""
     tbl = TextTable("%one")
     tbl.title = "test title"
     tbl.append({'one': 'foo'})
     self.assertEqual(str(tbl), "= test title =\nONE\n---\nfoo")