示例#1
0
文件: test.py 项目: sapcc/tempest
    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()
示例#2
0
文件: test.py 项目: openstack/tempest
    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()
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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)