Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: aiohttp support #11

Open
benjaminr opened this issue Jan 5, 2019 · 0 comments
Open

Feature Request: aiohttp support #11

benjaminr opened this issue Jan 5, 2019 · 0 comments

Comments

@benjaminr
Copy link

Hey @cyprieng, think this a great library, but would love to see aiohttp support at some point.

I've had a brief look at this and wonder if swapping out httpretty for the mocket httpretty compatibility layer would be a suitable way to do it? I think the compatibility layer could work here and provide the asyncio support required.

httpretty.enable()
for i in swagger_files_url: # Get all given swagger files and url
base_url = i[1]
s = SwaggerParser(i[0])
swagger_url[base_url] = s
# Register all urls
httpretty.register_uri(
httpretty.GET, re.compile(base_url + r'/.*'),
body=get_data_from_request)
httpretty.register_uri(
httpretty.POST, re.compile(base_url + r'/.*'),
body=get_data_from_request)
httpretty.register_uri(
httpretty.PUT, re.compile(base_url + r'/.*'),
body=get_data_from_request)
httpretty.register_uri(
httpretty.PATCH, re.compile(base_url + r'/.*'),
body=get_data_from_request)
httpretty.register_uri(
httpretty.DELETE, re.compile(base_url + r'/.*'),
body=get_data_from_request)
memory[base_url] = StubMemory(s)
yield memory[base_url]
# Close httpretty
httpretty.disable()
httpretty.reset()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant