def test_system_percent(self): process_cpu_usage = ProcessCpuUsage(1,1.34,self.__metric_repository) test_system_percent = float("%.2f"%(100*(112243-112233)/(1.34*1000))) system_percent = process_cpu_usage.system_percent() self.assertEquals(system_percent, test_system_percent)
def test_system_percent_if_previous_value_is_None(self): process_cpu_usage = ProcessCpuUsage(2,1.34,self.__metric_repository) system_percent = process_cpu_usage.system_percent() self.assertIsNone(system_percent, None)
def test_system_percent(self): process_cpu_usage = ProcessCpuUsage(1,1.34,self.__metric_repository) system_percent = process_cpu_usage.system_percent() self.assertEquals(system_percent, 0.75)
def test_system_percent_if_previous_value_is_None(self): process_cpu_usage = ProcessCpuUsage(2, 1.34, self.__metric_repository) system_percent = process_cpu_usage.system_percent() self.assertIsNone(system_percent, None)
def test_system_percent(self): process_cpu_usage = ProcessCpuUsage(1, 1.34, self.__metric_repository) system_percent = process_cpu_usage.system_percent() self.assertEquals(system_percent, 0.75)