Exemplo n.º 1
0
 def test_returns_zero_for_empty_history(self):
     self.host_os.cpu_times_shifted.return_value = None
     for state in CPU_TIMES:
         percent = cpu.util('all', state=state, host_os=self.host_os)
         assert_is_instance(percent, float)
         assert_equal(0, percent)
Exemplo n.º 2
0
 def test_returns_float_less_than_hundred(self):
     for state in CPU_TIMES:
         percent = cpu.util('all', state=state, host_os=self.host_os)
         assert_is_instance(percent, float)
         assert_greater(100, percent)
Exemplo n.º 3
0
 def test_does_not_raise_exception_for_cpu_all(self):
     cpu.util('all', host_os=self.host_os)
Exemplo n.º 4
0
 def test_returns_zero_for_empty_history(self):
     self.host_os.cpu_times_shifted.return_value = None
     for state in CPU_TIMES:
         percent = cpu.util('all', state=state, host_os=self.host_os)
         assert_is_instance(percent, float)
         assert_equal(0, percent)
Exemplo n.º 5
0
 def test_returns_float_less_than_hundred(self):
     for state in CPU_TIMES:
         percent = cpu.util('all', state=state, host_os=self.host_os)
         assert_is_instance(percent, float)
         assert_greater(100, percent)
Exemplo n.º 6
0
 def test_does_not_raise_exception_for_cpu_all(self):
     cpu.util('all', host_os=self.host_os)