Exemplo n.º 1
0
def show_head_animation():

    bar = SimpleAnimatedProgressBar(speed=1000)
    bar.show_progress_bar()
    bar.increase(50)

    while (not bar.completed()):

        if random.randint(1, 500000) == random.randint(1, 500000):
            bar.increase(50)

        bar.show_progress_bar()
Exemplo n.º 2
0
def show_head_animation():

    bar = SimpleAnimatedProgressBar(speed=1000)
    bar.show_progress_bar()
    bar.increase(50)

    while(not bar.completed()):

        if random.randint(1, 500000) == random.randint(1, 500000):
            bar.increase(50)

        bar.show_progress_bar()
Exemplo n.º 3
0
    def test_animated_head_bar(self):
        """Tests the animated head bar"""
        total = 20
        bar = SimpleAnimatedProgressBar(speed=1990)
        times = 10
        bar.increase(100)

        self.assertEqual("[{0}|]".format('=' * (total - 1)), bar.progress_bar)

        for i in range(0, times):
            bar.progress_bar

        self.assertEqual("[{0}/]".format('=' * (total - 1)), bar.progress_bar)

        for i in range(0, times):
            bar.progress_bar
        self.assertEqual("[{0}-]".format('=' * (total - 1)), bar.progress_bar)

        for i in range(0, times):
            bar.progress_bar

        self.assertEqual("[{0}\\]".format('=' * (total - 1)), bar.progress_bar)
Exemplo n.º 4
0
    def test_animated_head_bar(self):
        """Tests the animated head bar"""
        total = 20
        bar = SimpleAnimatedProgressBar(speed=1990)
        times = 10
        bar.increase(100)

        self.assertEqual("[{0}|]".format('=' * (total - 1)), bar.progress_bar)

        for i in range(0, times):
            bar.progress_bar

        self.assertEqual("[{0}/]".format('=' * (total - 1)), bar.progress_bar)

        for i in range(0, times):
            bar.progress_bar
        self.assertEqual("[{0}-]".format('=' * (total - 1)), bar.progress_bar)

        for i in range(0, times):
            bar.progress_bar

        self.assertEqual("[{0}\\]".format('=' * (total - 1)), bar.progress_bar)