Exemple #1
0
 def testSetTopLine(self):
     ruler = SideRuler(parent=None)
     ruler.setTopLine(10)
     ruler.setNumLines(20)
     ruler.setGeometry((0,0,7,40))
     ruler.show()
     self.app.processEvents()
     self.assertEqual(self.screen.stringAt(0,0,10),  "10    ║...")
     self.assertEqual(self.screen.stringAt(0,1,10),  "11    ║...")
Exemple #2
0
 def testSetTopLine(self):
     ruler = SideRuler(parent=None)
     ruler.setTopLine(10)
     ruler.setNumLines(20)
     ruler.setGeometry((0, 0, 7, 40))
     ruler.show()
     self.app.processEvents()
     self.assertEqual(self.screen.stringAt(0, 0, 10), "10    ║...")
     self.assertEqual(self.screen.stringAt(0, 1, 10), "11    ║...")
Exemple #3
0
    def testBasicSideRulerRepresentation(self):
        ruler = SideRuler(parent=None)
        ruler.setNumRows(10)
        ruler.setGeometry((0,0,5,40))
        ruler.show()
        self.app.processEvents()
        self.assertEqual(self.screen.stringAt(0,0,10),  " 1   .....")
        self.assertEqual(self.screen.stringAt(0,1,10),  " 2   .....")
        self.assertEqual(self.screen.stringAt(0,9,10),  "10   .....")
        self.assertEqual(self.screen.stringAt(0,10,10), "~    .....")

        ruler.setNumRows(100)
        self.app.processEvents()
        self.assertEqual(self.screen.stringAt(0,0,10),  "  1  .....")
        self.assertEqual(self.screen.stringAt(0,1,10),  "  2  .....")
        self.assertEqual(self.screen.stringAt(0,9,10),  " 10  .....")
        self.assertEqual(self.screen.stringAt(0,10,10), " 11  .....")
Exemple #4
0
    def testBasicSideRulerRepresentation(self):
        ruler = SideRuler(parent=None)
        ruler.setNumLines(10)
        ruler.setGeometry((0, 0, 7, 40))
        ruler.show()
        self.app.processEvents()

        self.assertEqual(self.screen.stringAt(0, 0, 10), " 1    ║...")
        self.assertEqual(self.screen.stringAt(0, 1, 10), " 2    ║...")
        self.assertEqual(self.screen.stringAt(0, 9, 10), "10    ║...")
        self.assertEqual(self.screen.stringAt(0, 10, 10), "~     ║...")

        ruler.setNumLines(100)
        self.app.processEvents()
        self.assertEqual(self.screen.stringAt(0, 0, 10), "  1   ║...")
        self.assertEqual(self.screen.stringAt(0, 1, 10), "  2   ║...")
        self.assertEqual(self.screen.stringAt(0, 9, 10), " 10   ║...")
        self.assertEqual(self.screen.stringAt(0, 10, 10), " 11   ║...")