Пример #1
0
    def test_guest_nice_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        guest_nice = cpu_util.guest_nice()

        self.assertIsNone(guest_nice)
Пример #2
0
    def test_guest_nice_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        guest_nice = cpu_util.guest_nice()

        self.assertEqual(guest_nice, 0.26)
Пример #3
0
    def test_guest_nice(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        guest_nice = cpu_util.guest_nice()

        self.assertEqual(guest_nice, 0.52)
Пример #4
0
    def test_guest_nice_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        guest_nice  = cpu_util.guest_nice()

        self.assertIsNone(guest_nice)
Пример #5
0
    def test_guest_nice_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        guest_nice  = cpu_util.guest_nice()

        self.assertEqual(guest_nice,0.26)
Пример #6
0
    def test_guest_nice(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        guest_nice  = cpu_util.guest_nice()

        self.assertEqual(guest_nice,0.52)