Exemplo n.º 1
0
    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()
Exemplo n.º 2
0
    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()
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)