Example #1
0
    def test_trace_unpatch(self):
        # the application must not be traced if unpatch() is called
        unpatch()

        response = self.fetch('/custom_handler/')
        assert 400 == response.code

        traces = self.tracer.writer.pop_traces()
        assert 0 == len(traces)
Example #2
0
    def test_trace_unpatch(self):
        # the application must not be traced if unpatch() is called
        unpatch()

        response = self.fetch('/custom_handler/')
        eq_(400, response.code)

        traces = self.tracer.writer.pop_traces()
        eq_(0, len(traces))
Example #3
0
    def test_trace_unpatch(self):
        # the application must not be traced if unpatch() is called
        unpatch()

        response = self.fetch('/custom_handler/')
        eq_(400, response.code)

        traces = self.tracer.writer.pop_traces()
        eq_(0, len(traces))
Example #4
0
    def test_trace_unpatch_not_traced(self):
        # the untrace must be safe if the app is not traced
        unpatch()
        unpatch()

        response = self.fetch('/success/')
        eq_(200, response.code)

        traces = self.tracer.writer.pop_traces()
        eq_(0, len(traces))
Example #5
0
    def test_trace_unpatch(self):
        # the application must not be traced if unpatch() is called
        patch()
        unpatch()

        response = self.fetch('/success/')
        eq_(200, response.code)

        traces = self.tracer.writer.pop_traces()
        eq_(0, len(traces))
Example #6
0
    def test_trace_unpatch_not_traced(self):
        # the untrace must be safe if the app is not traced
        unpatch()
        unpatch()

        response = self.fetch('/success/')
        assert 200 == response.code

        traces = self.tracer.writer.pop_traces()
        assert 0 == len(traces)
Example #7
0
    def test_trace_unpatch(self):
        # the application must not be traced if unpatch() is called
        patch()
        unpatch()

        response = self.fetch('/success/')
        assert 200 == response.code

        traces = self.tracer.writer.pop_traces()
        assert 0 == len(traces)
Example #8
0
    def test_trace_unpatch_not_traced(self):
        # the untrace must be safe if the app is not traced
        unpatch()
        unpatch()

        response = self.fetch('/success/')
        eq_(200, response.code)

        traces = self.tracer.writer.pop_traces()
        eq_(0, len(traces))
Example #9
0
    def test_trace_unpatch(self):
        # the application must not be traced if unpatch() is called
        patch()
        unpatch()

        response = self.fetch('/success/')
        eq_(200, response.code)

        traces = self.tracer.writer.pop_traces()
        eq_(0, len(traces))
Example #10
0
 def tearDown(self):
     super(TornadoTestCase, self).tearDown()
     # unpatch Tornado
     unpatch()
     compat.reload_module(compat)
     compat.reload_module(app)