def testConsoleBase(self): c = console.ConsoleBase(out=None, caps=struct.Struct(color=False, overwrite=False)) self.assertEqual(c.BOLD, '') self.assertEqual(c.UP, '') c = console.ConsoleBase(out=None, caps=struct.Struct(color=True, overwrite=False)) self.assertNotEqual(c.BOLD, '') self.assertEqual(c.UP, '') c = console.ConsoleBase(out=None, caps=struct.Struct(color=False, overwrite=True)) self.assertEqual(c.BOLD, '') self.assertNotEqual(c.UP, '') c = console.ConsoleBase(out=None, caps=struct.Struct(color=True, overwrite=True)) self.assertNotEqual(c.BOLD, '') self.assertNotEqual(c.UP, '')
def CreateStringIOConsole(self): return console.ConsoleBase(out=StringIO(), caps=struct.Struct(color=True, overwrite=True))