def get_usable_width(self): writer = TerminalWriter(StringIO(), prefix='spam') Assert(writer.get_usable_width()) == writer.get_width() - len('spam') writer.indent() Assert(writer.get_usable_width()) == writer.get_width() - 8
def get_usable_width(self): writer = TerminalWriter(StringIO()) progressbar = ProgressBar([TextWidget('foobar')], writer) Assert(progressbar.get_usable_width()) == writer.get_usable_width() - 6