How to use the httpretty.HTTPretty.disable function in httpretty

To help you get started, we’ve selected a few httpretty examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github karan / HackerNewsAPI / tests / test_story_get_comments.py View on Github external
def tearDown(self):
        httpretty.HTTPretty.disable()
github duoduo369 / social_auth_demo / tests / oauth2.py View on Github external
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()
github karan / HackerNewsAPI / tests / test_story_fromid.py View on Github external
def tearDown(self):
        httpretty.HTTPretty.disable()
github gabrielfalcao / HTTPretty / tests / functional / test_passthrough.py View on Github external
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)
github deontologician / restnavigator / tests / test_hal_nav.py View on Github external
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()
github python-social-auth / social-app-django / tests / open_id.py View on Github external
def tearDown(self):
        self.strategy = None
        User.reset_cache()
        TestUserSocialAuth.reset_cache()
        TestNonce.reset_cache()
        TestAssociation.reset_cache()
        HTTPretty.disable()
github urschrei / pyzotero / test / test_zotero.py View on Github external
def tearDown(self):
        """ Tear stuff down
        """
        HTTPretty.disable()