Last active
August 29, 2015 14:13
-
-
Save tomviner/2f526511273f8a660585 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
import httpretty | |
@pytest.yield_fixture | |
def mock_out_devpi(): | |
httpretty.reset() | |
httpretty.enable() | |
# prevent all other urls, except those registered | |
httpretty.HTTPretty.allow_net_connect = False | |
hosts = ('pypi.local', 'pypi-zonza.company.local') | |
vidisdk_getjson_fixture = open('tests/package-getjson-fixture.json').read() | |
for host in hosts: | |
httpretty.register_uri( | |
httpretty.GET, | |
"http://{}/company/test/vidisdk".format(host), | |
body=vidisdk_getjson_fixture, | |
content_type="application/json") | |
yield | |
# clean-up phase | |
httpretty.disable() | |
httpretty.reset() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment