Пример #1
0
    def test_init(self):

        mock_zapi_client = mock.Mock()
        mock_init_counter_info = self.mock_object(
            performance.PerformanceLibrary, '_init_counter_info')

        library = performance.PerformanceLibrary(mock_zapi_client)

        self.assertEqual(mock_zapi_client, library.zapi_client)
        mock_init_counter_info.assert_called_once_with()
Пример #2
0
    def setUp(self):
        super(PerformanceLibraryTestCase, self).setUp()

        with mock.patch.object(performance.PerformanceLibrary,
                               '_init_counter_info'):
            self.zapi_client = mock.Mock()
            self.perf_library = performance.PerformanceLibrary(
                self.zapi_client)
            self.perf_library.system_object_name = 'system'
            self.perf_library.avg_processor_busy_base_counter_name = (
                'cpu_elapsed_time1')

        self._set_up_fake_pools()