示例#1
0
 def test_noChannelRendering(self):
     """
     Verify that the status widget renders properly when there is no focused
     channel in its model.
     """
     status = StatusWidget(DummyModel(None))
     status.render(self.width, self.height, self.terminal)
     expected = '[%s] (No Channel)' % (version,)
     self.assertEqual(str(self.terminal), expected + ' ' * (self.width - len(expected)))
示例#2
0
 def test_withChannelRendering(self):
     """
     Verify that the status widget renders properly when there is a focused
     channel in its model.
     """
     channel = '#example'
     status = StatusWidget(DummyModel(channel))
     status.render(self.width, self.height, self.terminal)
     expected = '[%s] %s' % (version, channel)
     self.assertEqual(str(self.terminal), expected + ' ' * (self.width - len(expected)))
示例#3
0
 def test_shortenedStatus(self):
     """
     Verify that if a new status is shorter than the previous status, the
     previous status is completely erased.
     """
     longChannel = '#long-channel-name'
     shortChannel = '#short'
     status = StatusWidget(DummyModel(longChannel))
     status.render(self.width, self.height, self.terminal)
     status = StatusWidget(DummyModel(shortChannel))
     status.render(self.width, self.height, self.terminal)
     expected = '[%s] %s' % (version, shortChannel)
     self.assertEqual(str(self.terminal), expected + ' ' * (self.width - len(expected)))
示例#4
0
 def test_sizeHint(self):
     """
     Verify that the status widget asks for only one line of display area.
     """
     status = StatusWidget(DummyModel(None))
     self.assertEqual(status.sizeHint(), (None, 1))