コード例 #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)