示例#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)