示例#1
0
    def test_user_time_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        user_time = cpu_util.user_time()

        self.assertIsNone(user_time)
示例#2
0
    def test_user_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        user_time = cpu_util.user_time()

        self.assertEqual(user_time, 0.15)
示例#3
0
    def test_user_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        user_time = cpu_util.user_time()

        self.assertEqual(user_time, 0.3)
示例#4
0
    def test_user_time_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        user_time  = cpu_util.user_time()

        self.assertIsNone(user_time)
示例#5
0
    def test_user_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        user_time  = cpu_util.user_time()

        self.assertEqual(user_time,0.15)
示例#6
0
    def test_user_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        user_time  = cpu_util.user_time()

        self.assertEqual(user_time,0.3)