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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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)