Beispiel #1
0
    def test_edges(self):
        s = Stats("[%s/%f/%t/%r/%p]", lambda: 0, 32)
        self.assertEqual(s.format(), "[0/0/0/0/-]")
        s.started = 3
        s.total = 5
        s.finished = 1
        self.assertEqual(s.format(), "[3/1/5/2/ 60.0]")

        s.started = 5
        s.finished = 5
        self.assertEqual(s.format(), "[5/5/5/0/100.0]")
Beispiel #2
0
    def test_edges(self):
        s = Stats('[%s/%f/%t/%r/%p]', lambda: 0, 32)
        self.assertEqual(s.format(), '[0/0/0/0/-]')
        s.started = 3
        s.total = 5
        s.finished = 1
        self.assertEqual(s.format(), '[3/1/5/2/ 60.0]')

        s.started = 5
        s.finished = 5
        self.assertEqual(s.format(), '[5/5/5/0/100.0]')
Beispiel #3
0
 def test_overall_rate(self):
     times = [0, 0, 5]
     s = Stats("[%o]", lambda: times.pop(0), 32)
     self.assertEqual(s.format(), "[-]")
     s.started = 3
     s.finished = 1
     s.total = 5
     self.assertEqual(s.format(), "[  0.2]")
Beispiel #4
0
 def test_overall_rate(self):
     times = [0, 0, 5]
     s = Stats('[%o]', lambda: times.pop(0), 32)
     self.assertEqual(s.format(), '[-]')
     s.started = 3
     s.finished = 1
     s.total = 5
     self.assertEqual(s.format(), '[  0.2]')