Exemplo n.º 1
0
class StatusBarTest(unittest.TestCase):
  def setUp(self):
    self.stdscr = Dummy_stdscr()
    self.statusbar = StatusBar(self.stdscr.getmaxyx()[0]-1, self.stdscr)

  def test_add_text(self):
    text = 'hello world'
    self.statusbar.add_text(text, 'left')
    assert self.statusbar.text_left == text
Exemplo n.º 2
0
 def setUp(self):
   self.scrollback = 200
   self.stdscr = Dummy_stdscr()
   self.pager = Pager(self.scrollback, self.stdscr)
   assert self.pager is not None
   assert self.pager.scrollback == self.scrollback
   assert self.pager.scroll_pos == 0
   assert self.pager.text_ypos == 0
   assert (self.pager.term_height, self.pager.term_width) \
       == self.stdscr.getmaxyx()
Exemplo n.º 3
0
class PagerTestCase(unittest.TestCase):
  def setUp(self):
    self.scrollback = 200
    self.stdscr = Dummy_stdscr()
    self.pager = Pager(self.scrollback, self.stdscr)
    assert self.pager is not None
    assert self.pager.scrollback == self.scrollback
    assert self.pager.scroll_pos == 0
    assert self.pager.text_ypos == 0
    assert (self.pager.term_height, self.pager.term_width) \
        == self.stdscr.getmaxyx()
  
  def test_add_text(self):
    text = 'hello world'
Exemplo n.º 4
0
 def setUp(self):
   self.stdscr = Dummy_stdscr()
   self.statusbar = StatusBar(self.stdscr.getmaxyx()[0]-1, self.stdscr)