def tearDown(self): super(BaseTestCase, self).tearDown() # insert pdb breakpoint when pause_teardown is enabled if CONF.pause_teardown: BaseTestCase.insert_pdb_breakpoint() if CONF.profiler.key: profiler.disable()
def tearDown(self): super(BaseTestCase, self).tearDown() # insert pdb breakpoint when pause_teardown is enabled if CONF.pause_teardown: BaseTestCase.insert_pdb_breakpoint() if CONF.profiler.key: profiler.disable()
def test_profiler_lifecycle(self): key = 'SECRET_KEY' uuid = 'ID' self.assertEqual({}, profiler._profiler) profiler.enable(key, uuid) self.assertEqual({'key': key, 'uuid': uuid}, profiler._profiler) profiler.disable() self.assertEqual({}, profiler._profiler)
def test_profiler_lifecycle(self): key = 'SECRET_KEY' uuid = 'ID' self.assertEqual({}, profiler._profiler) profiler.enable(key, uuid) self.assertEqual({'key': key, 'uuid': uuid}, profiler._profiler) profiler.disable() self.assertEqual({}, profiler._profiler)
def test_profiler_lifecycle_generate_trace_id(self, generate_uuid_mock): key = 'SECRET_KEY' uuid = 'ID' generate_uuid_mock.return_value = uuid self.assertEqual({}, profiler._profiler) profiler.enable(key) self.assertEqual({'key': key, 'uuid': uuid}, profiler._profiler) profiler.disable() self.assertEqual({}, profiler._profiler)
def test_profiler_lifecycle_generate_trace_id(self, generate_uuid_mock): key = 'SECRET_KEY' uuid = 'ID' generate_uuid_mock.return_value = uuid self.assertEqual({}, profiler._profiler) profiler.enable(key) self.assertEqual({'key': key, 'uuid': uuid}, profiler._profiler) profiler.disable() self.assertEqual({}, profiler._profiler)