Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tearDown(self):
httpretty.HTTPretty.disable()
def tearDown(self):
self.strategy = None
self.complete_url = None
self.backend = None
User.reset_cache()
TestUserSocialAuth.reset_cache()
TestNonce.reset_cache()
TestAssociation.reset_cache()
HTTPretty.disable()
def tearDown(self):
httpretty.HTTPretty.disable()
def tearDown(self):
httpretty.HTTPretty.disable()
def test_http_passthrough():
url = 'http://httpbin.org/status/200'
response1 = requests.get(url)
response1 = requests.get(url, stream=True)
HTTPretty.enable()
HTTPretty.register_uri(HTTPretty.GET, 'http://google.com/', body="Not Google")
response2 = requests.get('http://google.com/')
expect(response2.content).to.equal(b'Not Google')
response3 = requests.get(url, stream=True)
(response3.content).should.equal(response1.content)
HTTPretty.disable()
response4 = requests.get(url, stream=True)
(response4.content).should.equal(response1.content)
def httprettify():
'''Context manager to do what the @httprettified decorator does (without
mucking up py.test's magic)
'''
httpretty.HTTPretty.reset()
httpretty.HTTPretty.enable()
try:
yield httpretty.HTTPretty
finally:
httpretty.HTTPretty.disable()
def tearDown(self):
self.strategy = None
User.reset_cache()
TestUserSocialAuth.reset_cache()
TestNonce.reset_cache()
TestAssociation.reset_cache()
HTTPretty.disable()
def tearDown(self):
""" Tear stuff down
"""
HTTPretty.disable()
def tearDown(self):
httpretty.HTTPretty.disable()