Ejemplo n.º 1
0
 def test_set_cell_color_normal(self):
     w = Window(3, 3)
     w.set_cell_char(x=0, y=0, char='@')
     w.set_cell_fg(x=0, y=0, fg='brightyellow')
     w.set_cell_bg(x=1, y=0, bg='red')
     self.assertEqual(
         w.__repr__(),
         '\x1b[93;40m@\x1b[0m\x1b[37;41m \x1b[0m \n   \n   \n')
Ejemplo n.º 2
0
 def test_set_cell_char_normal(self):
     w = Window(3, 3)
     w.set_cell_char(x=1, y=0, char='@')
     self.assertEqual(w.__repr__(), ' @ \n   \n   \n')
Ejemplo n.º 3
0
 def test_set_cell_char_bad(self):
     w = Window(3, 3)
     with self.assertRaises(ValueError) as context:
         w.set_cell_char(x=1, y=0, char='multiple characters')
Ejemplo n.º 4
0
 def test_clear(self):
     w = Window(2, 2)
     w.set_cell_char(x=1, y=0, char='a')
     w.clear()
     self.assertEqual(w.__repr__(), '  \n  \n')