コード例 #1
0
ファイル: test_httplib.py プロジェクト: tebriel/dd-trace-py
    def test_unpatch(self):
        """
        When unpatching httplib
            we restore the correct module/methods
        """
        original_init = httplib.HTTPConnection.__init__.__wrapped__
        original_putrequest = httplib.HTTPConnection.putrequest.__wrapped__
        original_getresponse = httplib.HTTPConnection.getresponse.__wrapped__
        unpatch()

        self.assertEqual(httplib.HTTPConnection.__init__, original_init)
        self.assertEqual(httplib.HTTPConnection.putrequest, original_putrequest)
        self.assertEqual(httplib.HTTPConnection.getresponse, original_getresponse)
コード例 #2
0
    def test_unpatch(self):
        """
        When unpatching httplib
            we restore the correct module/methods
        """
        original_init = httplib.HTTPConnection.__init__.__wrapped__
        original_request = httplib.HTTPConnection.request.__wrapped__
        original_getresponse = httplib.HTTPConnection.getresponse.__wrapped__
        unpatch()

        self.assertEqual(httplib.HTTPConnection.__init__, original_init)
        self.assertEqual(httplib.HTTPConnection.request, original_request)
        self.assertEqual(httplib.HTTPConnection.getresponse, original_getresponse)
コード例 #3
0
    def tearDown(self):
        unpatch()

        super(HTTPLibBaseMixin, self).tearDown()
コード例 #4
0
ファイル: test_httplib.py プロジェクト: vrialland/dd-trace-py
 def tearDown(self):
     unpatch()
コード例 #5
0
ファイル: test_httplib.py プロジェクト: tebriel/dd-trace-py
 def tearDown(self):
     unpatch()