Exemplo n.º 1
0
 def __init__(self, filename, enable_rich=True):
     self.filename = filename
     self.viewer = ProgShotViewer(filename)
     self.enable_rich = enable_rich
     self.console = Console()
     self.films_count = len(self.viewer.films)
     objprint.config(color=False, depth=6)
     self._switch_film(0)
Exemplo n.º 2
0
 def test_config_element(self):
     config(elements=2)
     e = ObjTest({"first": 1, "second": 2, "third": 3})
     with io.StringIO() as buf, redirect_stdout(buf):
         objprint(e)
         output = buf.getvalue()
     self.assertIn("first", output)
     self.assertIn("second", output)
     self.assertNotIn("third", output)
     config(elements=None)
Exemplo n.º 3
0
 def test_config(self):
     config(indent=4)
     config(indent=2)
Exemplo n.º 4
0
 def test_config_none_exist(self):
     self.assertRaises(TypeError, lambda: config(height=50))