예제 #1
0
파일: test_cpu.py 프로젝트: blin/zabby
 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)
예제 #2
0
파일: test_cpu.py 프로젝트: blin/zabby
 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)
예제 #3
0
파일: test_cpu.py 프로젝트: blin/zabby
 def test_does_not_raise_exception_for_cpu_all(self):
     cpu.util('all', host_os=self.host_os)
예제 #4
0
파일: test_cpu.py 프로젝트: blin/zabby
 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)
예제 #5
0
파일: test_cpu.py 프로젝트: blin/zabby
 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)
예제 #6
0
파일: test_cpu.py 프로젝트: blin/zabby
 def test_does_not_raise_exception_for_cpu_all(self):
     cpu.util('all', host_os=self.host_os)