Пример #1
0
 def update(self):
     writer = TerminalWriter(StringIO())
     progressbar = ProgressBar([], writer, maxsteps=10)
     widget = PercentageBarWidget()
     states = [
         '[%s]' % (x + '.' * (10 - len(x)))
         for x in ('#' * i for i in xrange(1, 11))
     ]
     for state in states:
         progressbar.step += 1
         Assert(widget.update(progressbar, 12)) == state
Пример #2
0
 def update(self):
     writer = TerminalWriter(StringIO())
     progressbar = ProgressBar([], writer, maxsteps=10)
     widget = PercentageBarWidget()
     states = [
         '[%s]' % (x + '.' * (10 - len(x))) for x in (
             '#' * i for i in xrange(1, 11)
         )
     ]
     for state in states:
         progressbar.step += 1
         Assert(widget.update(progressbar, 12)) == state
Пример #3
0
 def finish(self):
     writer = TerminalWriter(StringIO())
     progressbar = ProgressBar([], writer, maxsteps=10)
     widget = PercentageBarWidget()
     Assert(widget.finish(progressbar, 12)) == '[##########]'
Пример #4
0
 def finish(self):
     writer = TerminalWriter(StringIO())
     progressbar = ProgressBar([], writer, maxsteps=10)
     widget = PercentageBarWidget()
     Assert(widget.finish(progressbar, 12)) == '[##########]'